JavaScript »ñÈ¡ä¯ÀÀÆ÷µÄÏÔʾÇøÓò´óСÐÅÏ¢
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.clientWidth;
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.clientHeight;
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetWidth (°üÀ¨±ßÏߵĿí);
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetHeight (°üÀ¨±ßÏߵĿí);
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£ºdocument.body.scrollWidth;
ÍøÒ³ÕýÎÄÈ«Îĸߣºdocument.body.scrollHeight;
ÍøÒ³±»¾íÈ¥µÄ¸ß£ºdocument.body.scrollTop;
ÍøÒ³±»¾íÈ¥µÄ×ó£ºdocument.body.scrollLeft;
ÍøÒ³ÕýÎIJ¿·ÖÉÏ£ºwindow.screenTop;
ÍøÒ³ÕýÎIJ¿·Ö×ó£ºwindow.screenLeft;
ÆÁÄ»·Ö±æÂʵĸߣºwindow.screen.height;
ÆÁÄ»·Ö±æÂÊµÄ¿í£ºwindow.screen.width;
ÆÁÄ»¿ÉÓù¤×÷Çø¸ß¶È£ºwindow.screen.availHeight;
ÆÁÄ»¿ÉÓù¤×÷Çø¿í¶È£ºwindow.screen.availWidth
Ïà¹ØÎĵµ£º
ÎÒÃǶ¼ÖªµÀjava¡¢c#¡¢vbµÈÓïÑÔ¶¼ÓÐsleepÔÝÍ£µÄº¯Êý£¬¶øJavaScript½Å±¾Ã»ÓÐÀàËƵŦÄÜ¡£
ÏÂÃæ¾ÍÊÇÎÒµÄʵÏֵķ½·¨£º
<mce:script type="text/javascript"><!--
function test()
{
var s="javascript--ÔÝÍ£º¯Êý";
setTimeout(
function(){
eval(sleep(test)); //Ö´ÐÐreturnÖ®ºóµÄ´úÂ룬Ҳ¾ÍÊÇ&ldq ......
µÚ8ÕÂ ·½·¨
JavaScript°üº¬ÁËÉÙÁ¿¿ÉÓÃÔÚ±ê×¼ÀàÐÍÉϵıê×¼·½·¨¡£
Array
array.concat(item…)
concat·½·¨·µ»ØÒ»¸öÐÂÊý×飬Ëü°üº¬arrayµÄdz¸´ÖÆ(shallow copy)²¢½«1¸ö»ò¶à¸ö²ÎÊýitem¸½¼ÓÔÚÆäºó¡£Èç¹û²ÎÊýitemÊÇÒ»¸öÊý×飬ÄÇôËüµÄÿ¸öÔªËػᱻ·Ö±ðÌí¼Ó¡£´ËÍ⣬Çë²Î¼û±¾ÕºóÃæµÄarray.push(item…)·½·¨¡ ......
jsµÄFunction¶ÔÏóÔÚµ÷Óùý³ÌÖоßÓÐÒ»¸öarguomentsÊôÐÔ£¬ËüÊÇÓɽű¾½âÊÍÆ÷´´½¨µÄ£¬ÕâÒ²ÊÇ´´½¨arguments¶ÔÏóΨһ;¾¶¡£arguments¶ÔÏó¿ÉÒÔ¿´×öÊÇÒ»¸öArray¶ÔÏó£¬Ëü¾ßÓÐlengthÊôÐÔ£¬¿ÉÒÔͨ¹ýÐòºÅ·ÃÎÊÿһ¸ö²ÎÊý¡£¶øÇÒ£¬Í¨¹ýarguments µÄcalleeÊôÐÔ¿ÉÒÔ»ñÈ¡¶ÔÖ»ÔÚÖ´ÐеÄFunction¶ÔÏóµÄÒýÓã¬ÈçÏ ......
¹ØÓÚ
JavaScript
ÕýÔò±í´ï¶ÔÏóµÄʹÓã¬Æä²Î¿¼ÊÖ²á½éÉÜÈçÏ£º
Óï·¨ 1
re = /
pattern
/
[flags
]
Óï·¨ 2
re = new RegExp("
pattern
",
["
flags
"
])
²ÎÊý
re
±ØÑ¡Ïî¡£½«Òª¸³ÖµÎªÕýÔò±í´ïʽģʽµÄ±äÁ¿Ãû¡£
Pattern
±ØÑ¡ÏҪʹÓõÄÕýÔò±í´ïʽģʽ¡£Èç¹ûʹÓÃÓï·¨ 1
£¬Óà &q ......
//»ñÈ¡µ±Ç°Îļþȫ·¾¶
<script language="javascript">
alert(window.location.href);
alert(window.location);
alert(location.href);
alert(parent.location.href);
alert(top.location.href);
alert(document.location.href);
alert(document.URL);
</scri ......