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

½ñÌìÍ·¶ù¸´²é´úÂ룬½á¹û·¢ÏÖÓеÄÒ³Ã沢ûÓÐÏàÓ¦µÄDOMÔªËØ£¬µ¼Öµ÷ÓÃfuction³ö´í¡£²ÉÓÃJavaScriptÖÐarguments¶ÔÏó¿ÉÒÔºÜÇáËɵĽâ¾öÕâ¸öÎÊÌ⣬¶ø²»ÐèÒªÔÙÈ¥ÅжÏÔªËØÖ®ÀàµÄ¡£so Good£¡
JavaScriptÖÐargumentsº¯Êý¶ÔÏóÊǸöÔÏó´ú±íÕýÔÚÖ´Ðеĺ¯ÊýºÍµ÷ÓÃËüµÄº¯ÊýµÄ²ÎÊý¡£Ê¹Ó÷½·¨£º
[function.]arguments[n ]
ÆäÖÐfunctionÊÇ ......

JavaScript ¹¹½¨ÀàºÍ´´½¨¶ÔÏóµÄ·½Ê½

1>¹¤³§º¯ÊýÀ´´´½¨¶ÔÏó(Factory)
     function createCar(){
var obj = new Object;
obj.name = "BWM";
obj.show = function(){
alert(this.name);
}
return obj;
}
var car1 = createCar();
var car2 = createCar();
car1.show();
car2.show();
2>¹¹Ô캯Êý´´½¨¶ÔÏó ......

(תÔØ)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±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
¡¡¡¡Ò»¡¢Ê²Ã´ÊDZհü£¿
¡¡¡¡“¹Ù·½”µÄ½âÊÍÊÇ£ºËùν“±Õ°ü ......

JavaScriptÈ¥³ý¿Õ¸ñµÄÈýÖÖ·½·¨ (trim)

·½·¨Ò»:
¸öÈËÈÏΪ×îºÃµÄ·½·¨.²ÉÓõÄÊÇÕýÔò±í´ïʽ,ÕâÊÇ×îºËÐĵÄÔ­Àí.
Æä´Î.Õâ¸ö·½·¨Ê¹ÓÃÁËJavaScript µÄprototype ÊôÐÔ
ÆäʵÄ㲻ʹÓÃÕâ¸öÊôÐÔÒ»Ñù¿ÉÒÔÓú¯ÊýʵÏÖ.µ«ÕâÑù×öºóÓÃÆðÀ´±È½Ï·½±ã.
ÏÂÃæ¾ÍÀ´¿´¿´Õâ¸öÊôÐÔÊÇÔõôÀ´ÓõÄ.
 
·µ»Ø¶ÔÏóÀàÐÍÔ­Ð͵ÄÒýÓá£
objectName.prototype
objectName ²ÎÊýÊǶÔÏóµÄÃû³Æ¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ