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

javascript µÃµ½µ±Ç°Ò³Ãæ¿ÉÊӸ߶ȺͿí¶È

function getHeight(){
    var yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
        yScroll = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        yScroll = document.body.offsetHeight;
    }
  
    var windowHeight;
    if (self.innerHeight) { // all except Explorer
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
    // Explorer 6 Strict Mode
       windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
       windowHeight = document.body.clientHeight;
    }
    // for small pages with total height less then height of the viewport
    if(yScroll < windowHeight){
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }
      return pageHeight;
}
         
function getWidth(){
        var xScroll
        if (window.innerHeight && window.scrollMaxY) {
        xScroll = document.body.scrollWidth;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all b


Ïà¹ØÎĵµ£º

(×ªÔØ)javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ


 
[ 2007-8-6 17:03:00 | By: ibrahim ]
 
javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ

ÏÈÀ´¿´¿´options¼¯ºÏµÄÕ⼸¸ö·½·¨£º
options.add(option)·½·¨Ïò¼¯ºÏÀïÌí¼ÓÒ»Ïîoption¶ÔÏó£»
options.remove(index)·½·¨ÒƳýoptions¼¯ºÏÖеÄÖ¸¶¨Ï
options(index)»òoptions.item(index)¿ÉÒÔͨ¹ýË÷Òý»ñÈ¡options¼¯º ......

JavaScriptµÄʼþ´úÀí

Èç¹ûÄãÏë½øÒ»²½Á˽âÈçºÎÓÃJavaScriptÀ´ÎªÍøÒ³Ìí¼Ó½»»¥ÐԵϰ£¬ÄãÒ²ÐíÒѾ­Ìý¹ýJavaScriptµÄʼþ´úÀí£¨event delegation£©ÁË£¬²¢ÇÒ»á¾õµÃÖ»ÓÐÄÇЩţ±ÆºæºæµÄJavaScript³ÌÐòÔ±²Å»á¹ØÐÄÕâÑù¸´ÔÓµÄÉè¼ÆÄ£Ê½¡£ÊÂʵÉÏ£¬Èç¹ûÄãÒѾ­ÖªµÀÔõôÑùÈ¥Ìí¼ÓJavaScriptµÄʼþ´¦ÀíÆ÷£¨event handler£©£¬ÊµÏÖʼþ´úÀíÒ²ÊǼþÇá¶øÒ×¾ÙµÄÊÂÇé¡£
J ......

ÈçºÎ±ÜÃâJavascriptʼþ°ó¶¨³öÏÖÄÚ´æÐ¹Â©

"These memory leaks often
occur as a result of circular references between JavaScript objects and
objects within IE’s DOM (document object model)."
GPDE Team Blog
Ã÷ÏÔµÄDOM¶ÔÏóÓë JavaScript¶ÔÏóÑ­»·ÒýÓúܺÃÅжϣ¬ÄѵÄÊÇÒþº¬µÄÑ­»·ÒýÓÃÅжϣ¡
Òþº¬µÄÑ­»·ÒýÓÃÐèҪͨ¹ý×÷ÓÃÓòÁ´½øÐзÖÎöÅÐ ......

ÕýÔò±í´ïʽ javascriptÍøÒ³¿ª·¢

´´½¨RegExp¶ÔÏóʵÀýµÄÁ½ÖÖ·½Ê½
 
1.ʹÓÃRegExp¶ÔÏóµÄÏÔʾ¹¹Ô캯Êý,Ó﷨Ϊ:new RegExp("pattern")[,"flags"];
2.ʹÓÃRegExp¶ÔÏóµÄÒþʾ¹¹Ô캯Êý,Ó﷨Ϊ:/pattern/flags;
 
3.flagsΪÒÔϱêÖ¾×Ö·ûµÄ×éºÏ
 
(1).g×÷È«¾Ö±êÖ¾,Èç¹ûûÓÐ,Æ¥ÅäµÚÒ»¸ö
 
(2). i ºöÂÔ´óСд
 
(3).m ¶àÐбêÖ¾
Õý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ