Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Javascript Êý×éѧϰһÔò

1. Ó¦ÓàArray.prototype.joinʵÏÖ×Ö·ûºÏ²¢
·½·¨1.
String.prototype.times = function(n) {
    return Array.prototype.join.call({length:n+1}, this);
};
"js".times(5)   // => "jsjsjsjsjs"
·½·¨2.
 var ArrayTest=new Array("HE","LL","O");
 var hello = Array.prototype.join.call(ArrayTest, '|');
 alert(hello);   // => "HE|LL|O");
 
2.×Ö·û´®·Ö¸î³ÉÊý×é
var  _param = "HE||LL||O"; 
var  _paramArray = _param.split("|");
    alert(_paramArray.length)


Ïà¹ØÎĵµ£º

Javascript±Õ°ü(Closure)

ClosureÖÐÎÄ·­ÒëΪ±Õ°ü.×ÖÃæÉÏÀ´Àí½â¾ÍÊÇ"·â±ÕµÄ°ü".(ÕâÊÇÒ»¾ä·Ï»°)
±Õ°üÊÇʲô?
ÊéÃæ½âÊÍΪ: Ëùν“±Õ°ü”£¬Ö¸µÄÊÇÒ»¸öÓµÓÐÐí¶à±äÁ¿ºÍ°ó¶¨ÁËÕâЩ±äÁ¿µÄ»·¾³µÄ±í´ïʽ£¨Í¨³£ÊÇÒ»¸öº¯Êý£©£¬Òò¶øÕâЩ±äÁ¿Ò²ÊǸñí´ïʽµÄÒ»²¿·Ö¡£
ÎÒÈÏΪ±Õ°ü¾ÍÊÇÄܹ»¶Á/дº¯ÊýÄÚ²¿µÄijЩ±äÁ¿µÄ×Óº¯Êý,²¢½«ÕâЩ±äÁ¿±£´æÔÚÄÚ´æÖÐ.
± ......

JavaScript»ñÈ¡µ±Ç°Îļþȫ·¾¶¡¢µ±Ç°Ä¿Â¼¡¢µ±Ç°ÎļþÃû

//»ñÈ¡µ±Ç°Îļþȫ·¾¶
<script language="javascript"> 
alert(window.location.href); 
alert(window.location); 
alert(location.href); 
alert(parent.location.href); 
alert(top.location.href); 
alert(document.location.href); 
alert(document.URL);
</scri ......

Javascript: setTimeout()ʹÓü° setInterval()ʹÓÃ

Evaluates an expression after a specified number of milliseconds has elapsed.
(ÔÚÖ¸¶¨Ê±¼ä¹ýºóÖ´ÐÐÖ¸¶¨µÄ±í´ïʽ)
Syntax:
iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])
Parameters
vCode
Required. Variant that specifies the function pointer or string that indicates the code to be ......

Firefox ×îРJavaScript ÒýÇæ³õ̽

×Ô´Ó Google ÍÆ³öº¬ V8 JavaScript ÒýÇæµÄ Chrome ÒÔÀ´£¬¹«ÖÚ¶Ô JavaScript
ÒýÇæÖ´ÐÐЧÂʵÄθ¿ÚÓÖÒ»´Î±»Ìá¸ß£¬ÖÚ¶àä¯ÀÀÆ÷µÄ¿ª·¢ÕßÃǽʾ¡ÄÔÖ­ÌáÉýËûÃÇµÄ JavaScript ÐÔÄÜ£¬Opera ×îеÄ10.50 °æµÄ Carakan

ÒýÇæ¾Ý³ÆÒѾ­³¬¹ý V8£¬¶ø Firefox µÄ¿ª·¢ÕßÃÇÒ²²»¸ÊʾÈõ¡£
×î½üÉý¼¶µ½ Firefox 3.6 µÄÓû§ÒѾ­·¢ÏÖËûÃÇµÄ Java ......

javascript ¶¯Ì¬²åÈëÐÐ ±í¸ñ²Ù×÷

<script>  
    var i = 0;
    function insertTr(obj)  
    {  
        var tr1 =  tb.insertRow(obj.rowIndex+1);  
        ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ