ÈçºÎÎÒ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>
Ïà¹ØÎĵµ£º
µÚÎåÕ Strings and Regular Expressions ×Ö·û´®ºÍÕýÔò±í´ïʽ
Practically all JavaScript programs are intimately tied to strings. For example, many applications use Ajax to fetch strings from a server, convert those strings into more easily usable JavaScript objects, and ......
Data Format Conclusions Êý¾Ý¸ñʽ×ܽá
Favor lightweight formats in general; the best are JSON and a character-delimited custom format. If the data set is large and parse time becomes an issue, use one of these two techniques:
×ܵÄÀ´ËµÔ½ÇáÁ¿¼¶µÄ¸ñʽԽºÃ£¬× ......
JavaScript Minification JavaScript½ô´Õ
JavaScript minification is the process by which a JavaScript file is stripped of everything that does not contribute to its execution. This includes comments and unnecessary whitespace. The process typically reduces the file size by ha ......