ÈçºÎÎÒjavaScript»ñÈ¡´°¿ÚµÄ¸ß¶ÈºÍ¿í¶È
ÔÚjavascriptÖеõ½µ±Ç°´°¿ÚµÄ¸ßºÍ¿í
<body><SCRIPT LANGUAGE="JavaScript">
var s = "";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.offsetWidth +" (°üÀ¨±ßÏߺ͹ö¶¯ÌõµÄ¿í)";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.offsetHeight +" (°üÀ¨±ßÏߵĿí)";
s += "\r\nÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º"+ document.body.scrollWidth;
s += "\r\nÍøÒ³ÕýÎÄÈ«Îĸߣº"+ document.body.scrollHeight;
s += "\r\nÍøÒ³±»¾íÈ¥µÄ¸ß£º"+ document.body.scrollTop;
s += "\r\nÍøÒ³±»¾íÈ¥µÄ×ó£º"+ document.body.scrollLeft;
s += "\r\nÍøÒ³ÕýÎIJ¿·ÖÉÏ£º"+ window.screenTop;
s += "\r\nÍøÒ³ÕýÎIJ¿·Ö×ó£º"+ window.screenLeft;
s += "\r\nÆÁÄ»·Ö±æÂʵĸߣº"+ window.screen.height;
s += "\r\nÆÁÄ»·Ö±æÂÊµÄ¿í£º"+ window.screen.width;
s += "\r\nÆÁÄ»¿ÉÓù¤×÷Çø¸ß¶È£º"+ window.screen.availHeight;
s += "\r\nÆÁÄ»¿ÉÓù¤×÷Çø¿í¶È£º"+ window.screen.availWidth;
s += "\r\nÄãµÄÆÁÄ»ÉèÖÃÊÇ "+ window.screen.colorDepth +" λ²ÊÉ«";
s += "\r\nÄãµÄÆÁÄ»ÉèÖà "+ window.screen.deviceXDPI +" ÏñËØ/Ó¢´ç";
alert(s);
</SCRIPT>
Ïà¹ØÎĵµ£º
Use the Fast Parts ʹÓÃËٶȿìµÄ²¿·Ö
Even though JavaScript is often blamed for being slow, there are parts of the language that are incredibly fast. This should come as no surprise, since JavaScript engines are built in lower-level languages and are therefore compiled. Thou ......
µÚ¾ÅÕÂ
Building and Deploying High-Performance JavaScript Applications
´´½¨²¢²¿Êð¸ßÐÔÄÜJavaScriptÓ¦ÓóÌÐò
According to a 2007 study by Yahoo!'s Exceptional Performance team, 40%–60% of Yahoo!'s users have an empty cache experience, and about 20% of all page views are done ......
ÐÂÖÐ……
1¡¢Êý¾ÝÀàÐÍÑéÖ¤ÎÊÌâ
Asp.NetËäÈ»ÓÐÑéÖ¤¿Ø¼þ£¬µ«ÊÇÓÐЩ¸´ÔÓµÄÑéÖ¤»¹Êǵô«µ½·þÎñÆ÷ÉϽøÐУ¬ÓÃjsËٶȺÍÐÔÄܶ¼±È½ÏºÃ
<script>
//¼ì²éÊÇ·ñΪÈÎÒâÊý£¨ÊµÊý£©
function isNumeric(strNumber) {
var newPar=/^(-|\+)?\d+(\.\d+)?$/
alert(newPar.test(strNumber)); }
//¼ ......
JavaScriptÊÇ»ùÓÚ¶ÔÏóµÄ£¬ÈκÎÔªËض¼¿ÉÒÔ¿´³É¶ÔÏó¡£È»¶ø£¬ÀàÐͺͶÔÏóÊDz»Í¬µÄ¡£±¾ÎÄÖУ¬ÎÒÃdzýÁËÌÖÂÛÀàÐͺͶÔÏóµÄһЩÌصãÖ®Í⣬¸üÖØÒªµÄÊÇÑо¿ÈçºÎд³öºÃµÄ²¢ÇÒÀûÓÚÖØÓõÄÀàÐÍ¡£±Ï¾¹£¬JavaScriptÕâÖÖÁ÷ÐеĽű¾ÓïÑÔÈç¹ûÄܹ»½øÐÐÁ¼ºÃµÄ·â×°£¬²¢ÐγÉÒ»¸öÅÓ´óµÄÀàÐͿ⣬¶ÔÓÚÖØÓÃÊǷdz£ÓÐÒâÒåµÄ¡£
ÍøÉ϶ÔÓÚprototypeµÄÎÄÕ弆 ......