Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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¼ò½é


ÔÚÊý°ÙÍòÕÅÒ³ÃæÖУ¬JavaScript ±»ÓÃÀ´¸Ä½øÉè¼Æ¡¢ÑéÖ¤±íµ¥¡¢¼ì²âä¯ÀÀÆ÷¡¢´´½¨cookies£¬µÈµÈµÈµÈ¡£
JavaScript ÊÇÒòÌØÍøÉÏ×îÁ÷ÐеĽű¾ÓïÑÔ£¬²¢ÇÒ¿ÉÔÚËùÓÐÖ÷ÒªµÄä¯ÀÀÆ÷ÖÐÔËÐУ¬±È·½Ëµ Internet
Explorer¡¢ Mozilla¡¢Firefox¡¢Netscape¡¢ºÍ Opera¡£
            ......

JavaScriptµ÷ÊÔ¼¼ÇÉÖ®£º¶Ïµãµ÷ÊÔ(1)


Èç¹ûÄú»¹Ã»ÓÐÔĶÁ¡¶JavaScriptµ÷ÊÔ¼¼ÇÉÖ®£º¿ìËÙ¶¨Î»¡·£¬½¨ÒéÏÈ¿´¿´ÄÇƪ¡£Ëµ²»¶¨£¬ÓÿìËÙ¶¨Î»¾ÍÄܽâ¾öÎÊÌâÁË£¬ºÇºÇ¡£Õâ´ÎÎÒ»á×ܽá¼Ç¼һ϶ϵãµ÷ÊԵıʼǣ¬Ï£ÍûÒ²¶Ô´ó¼ÒÓÐÓ㬻¶Ó­²¹³ä½»Á÷£¡
Ê×ÏÈ£¬ÔÚ¸÷¸öä¯ÀÀÆ÷ÖУ¬¶Ïµãµ÷ÊÔÖ§³ÖµÄ×îºÃµÄµ±È»ÊÇFirefox£¬Firefox²»½ö¿ÉÒÔʹÓÃFirebugµ÷ÊÔÒ³Ãæjs½Å±¾£¬»¹¿ÉÒÔÓø߼¶µ÷ÊÔ¹¤¾ßÀ ......

javascriptÓÅ»¯·½·¨

ÐÞ¸ÄÑ­»·µÄÖ´Ðз½Ê½
for(var i=0;i<element.childNodes.length;i++){
Ö´ÐдúÂë
}
ÕâÖÖ·½Ê½Ã¿´ÎÑ­»·¶¼ÒªÈ¡element.childNodes.lengthµÄÖµ£¬Ó¦¸Ã¸ÄΪÈçϵÄ
var n£½element.childNodes.length
for(var i=0;i<n;i++){
Ö´ÐдúÂë
}
2£ºÐÞ¸Ädom²Ù×÷µÄ´ÎÊý
domÅúÁ¿²åÈëÒ»ÅúÀàËƵĽڵ㲻ÈçÏȹ¹ÔìÒ»¸ö¶ÔÏó£¬ ......

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

<script>  
    var i = 0;
    function insertTr(obj)  
    {  
        var tr1 =  tb.insertRow(obj.rowIndex+1);  
        ......

javascript ½ûÖ¹Êó±êÓÒ¼ü...

<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" onmouseup=document.selection.empty() oncopy=document.selection.empty() onselect=document.selection.empty()></body>
½²ÉÏÃæºìÉ«ÏÔʾµÄ²åÈëµ½ÍøÒ³ÖоͿÉÒÔʵÏÖÊó±êÓÒ»÷ÎÞЧ
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ