Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 Array ¿ÉÒÔÀ©Õ¹µÄ¼¸¸ö·½·¨

     indexOf
·µ»ØÔªËØÔÚÊý×éµÄË÷Òý£¬Ã»ÓÐÔò·µ»Ø-1¡£ÓëstringµÄindexOf·½·¨²î²»¶à¡£
Èç¹ûÆäËûä¯ÀÀÆ÷ûÓÐʵÏÖ´Ë·½·¨£¬¿ÉÒÔÓÃÒÔÏ´úÂëʵÏÖ¼æÈÝ£º
Array.prototype.indexOf = function(el, start) {
var start = start || 0;
for ( var i=0; i < this.length; ++i ) {
......

javascriptѧϰ·½·¨

 1.²»¹ýÎÒ½ÌÄãÒ»¸öѧ×öÍøÒ³µÄ¼¼ÇÉ
ÿ¿´µ½Ò»¸öƯÁÁµÄÍøÒ³¾Í²é¿´Ï´úÂë
2.¿´ÕÅТÏéµÄÊÓƵ
3¡£´Ó»ù´¡Ñ§Æð¡£È»ºóѧЩ»ù±¾µÄWEB¿ª·¢Ó¦ÓÃ
ÍƼöÒ»¸öÍøÕ¾http://www.ccscript.cn/
¸ÃÕ¾Ïêϸ·ÖÀàJSµÄ»ù´¡,¶ÔÏó,¼«ÆäÓ¦Óã»
¸ÃÕ¾ÓжàÖÖµ±½ñÁ÷ÐеÄJS¿ò¼Ü£»
Õ¾ÄÚÖ÷´òJquery¿ò¼ÜµÄ»ù´¡¼°Ó¦Óã»
°üÀ¨ÌØЧ´úÂëºÍչʾÌØЧ£» ......

JavaScriptÑéÖ¤ÕýÔò±í´ïʽ´óÈ«

JavaScriptÑéÖ¤ÕýÔò±í´ïʽ´óÈ«
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º [\u4E00-\uFA29]
ÆÀ×¢£ºÆ¥ÅäÖÐÎÄ»¹ÕæÊǸöÍ·ÌÛµÄÊ£¬ÓÐÁËÕâ¸ö±í´ïʽ¾ÍºÃ°ìÁË
Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)£º[^x00-xff]
ÆÀ×¢£º¿ÉÒÔÓÃÀ´¼ÆËã×Ö·û´®µÄ³¤¶È£¨Ò»¸öË«×Ö½Ú×Ö·û³¤¶È¼Æ2£¬ASCII×Ö·û¼Æ1£©
Æ¥Åä¿Õ°×ÐеÄÕýÔò±í´ïʽ£ºns*r
ÆÀ×¢£º¿ÉÒÔÓÃÀ´É¾³ý¿Õ°×ÐÐ
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ