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

javascriptÕÚÕÖ²ã(ת×Ôwww.cnblogs.com/wjfluisfigo)

//»ñÈ¡ä¯ÀÀÆ÷µÄ¿íºÍ¸ß£¨¶àÖÖä¯ÀÀÆ÷£©
function getNavWidthandHeightInfo()
{
    var s = "";
    s += " ÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
    s += " ÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight;
    s += " ÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.offsetWidth + " (°üÀ¨±ßÏߺ͹ö¶¯ÌõµÄ¿í)";
    s += " ÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.offsetHeight + " (°üÀ¨±ßÏߵĿí)";
    s += " ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º"+ document.body.scrollWidth;
    s += " ÍøÒ³ÕýÎÄÈ«Îĸߣº"+ document.body.scrollHeight;
    s += " ÍøÒ³±»¾íÈ¥µÄ¸ß(ff)£º"+ document.body.scrollTop;
    s += " ÍøÒ³±»¾íÈ¥µÄ¸ß(ie)£º"+ document.documentElement.scrollTop;
    s += " ÍøÒ³±»¾íÈ¥µÄ×ó£º"+ document.body.scrollLeft;
    s += " ÍøÒ³ÕýÎIJ¿·ÖÉÏ£º"+ window.screenTop;
    s += " ÍøÒ³ÕýÎIJ¿·Ö×ó£º"+ window.screenLeft;
    s += " ÆÁÄ»·Ö±æÂʵĸߣº"+ window.screen.height;
    s += " ÆÁÄ»·Ö±æÂÊµÄ¿í£º"+ window.screen.width;
    s += " ÆÁÄ»¿ÉÓù¤×÷Çø¸ß¶È£º"+ window.screen.availHeight;
    s += " ÆÁÄ»¿ÉÓù¤×÷Çø¿í¶È£º"+ window.screen.availWidth;
    s += " ÄãµÄÆÁÄ»ÉèÖÃÊÇ: "+ window.screen.colorDepth +" Î»²ÊÉ«";
    s += " ÄãµÄÆÁÄ»ÉèÖÃ: "+ window.screen.deviceXDPI +" ÏñËØ/Ó¢´ç";
    s += "µ±Ç°´°¿ÚµÄÄÚ²¿¿í¶È:"+ window.innerWidth;
&nbs


Ïà¹ØÎĵµ£º

javascriptÖÐsubstr,substring,slice.spliceµÄÇø±ð

substr() ·½·¨¿ÉÔÚ×Ö·û´®ÖгéÈ¡´Ó start ϱ꿪ʼµÄÖ¸¶¨ÊýÄ¿µÄ×Ö·û.
stringObject.substr(start,length);start±ØÐë,length¿ÉÑ¡.
start ÊǽØÈ¡µÄ¿ªÊ¼Î»ÖõÄϱê,´Ó0¿ªÊ¼ËãÆð,±ØÐëÊÇÊý×Ö.¿ÉÒÔÊǸºÊý,-1Êǵ¹ÊýµÚÒ»¸ö×Ö·û,-2Êǵ¹ÊýµÚ¶þ¸ö×Ö·û,ÒÔ´ËÀàÍÆ.
length ÊÇÒª½ØÈ¡µÄ×Ö·ûµÄ³¤¶È,±ØÐëÊÇÊý×Ö.Èç¹ûδָ¶¨,Ôò´ÓstartλÖô¦¿ ......

³£ÓõÄJavaScriptÑéÖ¤ÕýÔò±í´ïʽ

³£ÓõÄJavaScriptÑéÖ¤ÕýÔò±í´ïʽ
ÏÂÃ涼ÊÇÎÒÊÕ¼¯µÄһЩ±È½Ï³£ÓõÄÕýÔò±í´ïʽ£¬ÒòΪƽ³£¿ÉÄÜÔÚ±íµ¥ÑéÖ¤µÄʱºò£¬Óõ½µÄ±È½Ï¶à¡£ÌØ·¢³öÀ´£¬Èø÷λÅóÓѹ²Í¬Ê¹Ó᣺Ǻǡ£
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º [u4e00-u9fa5]
ÆÀ×¢£ºÆ¥ÅäÖÐÎÄ»¹ÕæÊǸöÍ·ÌÛµÄÊ£¬ÓÐÁËÕâ¸ö±í´ïʽ¾ÍºÃ°ìÁË
Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)£º[^x00-xff]
ÆÀ×¢ ......

javascript£º»ñÈ¡ÆÁÄ»¸ß¶ÈºÍ¿í¶ÈµÈÐÅÏ¢

ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.clientWidth
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.clientHeight
ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.offsetWidth (°üÀ¨±ßÏߵĿí)
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.offsetHeight (°üÀ¨±ßÏߵĸß)
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º document.body.scrollWidth
ÍøÒ³ÕýÎÄÈ«Îĸߣº document.body.scrollHeight ......

×Ô¶¯µãÍøÒ³ÖеÄJavaScriptÁ´½Ó


‘µãÕý³£Á´½Ó·½·¨ºÜ¶à£¬ÕâÀï½éÉܵÄÊÇ×Ô¶¯µãJavaScriptÁ´½Ó
Function RunJS(scripts)
‘VB ×Ô¶¯µãÍøÒ³ÖеÄJavascriptÁ´½Ó
Dim Document
                On Error GoTo ErrHandle
        ......

javascript Ö® prototype

function MyObject1(formalParameter){
    alert("MyObject1");    
    this.testNumber = formalParameter;
    //1
    this.toString= function(){
       alert("MyObject1:"+this.testNumber);
   &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ