Îò͸JavaScript (1)
Òý×Ó
¡¡¡¡±à³ÌÊÀ½çÀïÖ»´æÔÚÁ½ÖÖ»ù±¾ÔªËØ£¬Ò»¸öÊÇÊý¾Ý£¬Ò»¸öÊÇ´úÂë¡£±à³ÌÊÀ½ç¾ÍÊÇÔÚÊý¾ÝºÍ´úÂëǧ˿ÍòÂƵľÀ²øÖгÊÏÖ³öÎÞÏÞµÄÉú»úºÍ»îÁ¦¡£
¡¡¡¡Êý¾ÝÌìÉú¾ÍÊÇÎľ²µÄ£¬×ÜÏë±£³Ö×Ô¼º¹ÌÓеı¾É«£»¶ø´úÂëÈ´ÌìÉú»îÆã¬×ÜÏë¸Ä±äÕâ¸öÊÀ½ç¡£
¡¡¡¡Äã¿´£¬Êý¾Ý´úÂë¼äµÄ¹ØϵÓëÎïÖÊÄÜÁ¿¼äµÄ¹ØϵÓÐמªÈ˵ÄÏàËÆ¡£Êý¾ÝÒ²ÊÇÓйßÐԵģ¬Èç¹ûûÓдúÂëÀ´Ê©¼ÓÍâÁ¦£¬Ëý×ܱ£³Ö×Ô¼ºÔÀ´µÄ״̬¡£¶ø´úÂë¾ÍÏóÄÜÁ¿£¬Ëû´æÔÚµÄΨһĿµÄ£¬¾ÍÊÇҪŬÁ¦¸Ä±äÊý¾ÝÔÀ´µÄ״̬¡£ÔÚ´úÂë¸Ä±äÊý¾ÝµÄͬʱ£¬Ò²»áÒòΪÊý¾ÝµÄ¿¹¾Ü¶ø·´¹ýÀ´Ó°Ïì»ò¸Ä±ä´úÂëÔÓеÄÇ÷ÊÆ¡£ÉõÖÁÔÚijЩÇé¿öÏ£¬Êý¾Ý¿ÉÒÔת±äΪ´úÂ룬¶ø´úÂëÈ´ÓÖÓпÉÄܱ»×ª±äΪÊý¾Ý£¬»òÐí»¹´æÔÚÒ»¸öÀàËÆE=MC2ÐÎʽµÄÊýÂëת»»·½³ÌÄØ¡£È»¶ø£¬¾ÍÊÇÔÚÊý¾ÝºÍ´úÂë¼äÕâÖÖ¼´Ã¬¶ÜÓÖͳһµÄÔËתÖУ¬×ÜÄÜÌåÏÖ³ö¼ÆËã»úÊÀ½çµÄ¹æÂÉ£¬ÕâЩ¹æÂÉÕýÊÇÎÒÃDZàдµÄ³ÌÐòÂß¼¡£
¡¡¡¡²»¹ý£¬ÓÉÓÚ²»Í¬³ÌÐòÔ±ÓÐ×Ų»Í¬µÄÊÀ½ç¹Û£¬ÕâЩÊý¾ÝºÍ´úÂë¿´ÆðÀ´Ò²¾Í²»¾¡Ïàͬ¡£ÓÚÊÇ£¬²»Í¬ÊÀ½ç¹ÛµÄ³ÌÐòÔ±ÃÇÔËÓø÷×Եķ½·¨ÂÛ£¬Íƶ¯×űà³ÌÊÀ½çµÄ½ø»¯ºÍ·¢Õ¹¡£
¡¡¡¡ÖÚËùÖÜÖª£¬µ±½ñ×îÁ÷Ðеıà³Ì˼ÏëĪ¹ýÓÚÃæÏò¶ÔÏó±à³ÌµÄ˼Ï롣ΪʲôÃæÏò¶ÔÏóµÄ˼ÏëÄÜѸËÙ·çÃÒ±à³ÌÊÀ½çÄØ£¿ÒòΪÃæÏò¶ÔÏóµÄ˼ÏëÊ״ΰÑÊý¾ÝºÍ´úÂë½áºÏ³ÉͳһÌ壬²¢ÒÔÒ»¸ö¼òµ¥µÄ¶ÔÏó¸ÅÄî³ÊÏÖ¸ø±à³ÌÕß¡£ÕâÒ»ÏÂ×Ӿͽ«ÔÀ´ÄÇЩÔÓÂÒµÄËã·¨Óë×Ó³ÌÐò£¬ÒÔ¼°¾À²ø²»ÇåµÄ¸´ÔÓÊý¾Ý½á¹¹£¬»®·Ö³ÉÇåÎú¶øÓÐÐòµÄ¶ÔÏó½á¹¹£¬´Ó¶øÀíÇåÁËÊý¾ÝÓë´úÂëÔÚÎÒÃÇÐÄÖÐÄÇÍÅÂÒÂé°ãµÄ½á¡£ÎÒÃÇÓÖ¿ÉÒÔÓÐÒ»¸ö¸üÇåÎúµÄ˼ά£¬ÔÚÁíÒ»¸ö˼Ïë¸ß¶ÈÉÏȥ̽Ë÷¸ü¼ÓºÆ嫵ıà³ÌÊÀ½çÁË¡£
¡¡¡¡ÔÚÎå×æºëÈ̽²ÊÚÍ꡶¶ÔÏóÕ澡·Ö®ºóµÄÒ»Ì죬Ëû¶ÔÖÚµÜ×ÓÃÇ˵£º“¾Òѽ²Í꣬Ïë±Ø¶ûµÈÓ¦¸ÃÓÐËù¸ÐÎò£¬Çë¸÷×Ôд¸öÙÊ×ÓÀ´¿´”¡£´óµÜ×ÓÉñÐãÊDZ»´ó¼Ò¹«ÈÏΪÎòÐÔ×î¸ßµÄʦÐÖ£¬ËûµÄÙÊ×ÓдµÀ£º“ÉíÊǶÔÏóÊ÷£¬ÐÄÈçÀà°ãÃ÷¡£³¯³¯ÇÚ·÷Êã¬ÄªÈÃÈdz¾°££¡”¡£´ËÙÊÒ»³ö£¬Á¢¼´ÒýÆðʦÐÖµÜÃǵĺ䶯£¬´ó¼Ò¶¼ËµÐ´µÃÌ«ºÃÁË¡£Ö»ÓлðÍ·É®»ÛÄÜ¿´ºó£¬ÇáÇáµØ̾ÁË¿ÚÆø£¬ÓÖËæÊÖÔÚǽÉÏдµÀ£º“¶ÔÏó±¾ÎÞ¸ù£¬ÀàÐÍÒàÎÞÐΡ£±¾À´ÎÞÒ»ÎºÎ´¦Èdz¾°££¿”¡£È»ºóÒ¡ÁËÒ¡Í·£¬Ñﳤ¶øÈ¥¡£´ó¼Ò¿´ÁË»ÛÄܵÄÙÊ×Ó¶¼Ëµ£º“дµÄʲôÂÒÆß°ËÔãµÄ°¡£¬¿´²»¶®”¡£Ê¦¸¸ºëÈÌ¿´ÁËÉñÐãµÄÊ«ÙÊÒ²µãÍ·³ÆÔÞ£¬ÔÙ¿´»ÛÄܵÄÊ«ÙÊÖ®ºóĬȻҡͷ¡£¾ÍÔÚµ±ÌìÒ¹ÀºëÈÌÈ´ÇÄÇÄ°Ñ»ÛÄܽе½×Ô¼ºµÄìø·¿£¬½«Õä²Ø¶àÄêµÄÈí¼þÕæ¾´«ÊÚÓÚËû£¬È»ºóÈÃËû³Ã×ÅÔÂÉ«Á¬Ò¹ÌÓ×ß...
¡¡¡¡ºóÀ´£¬»ÛÄܹûÈ»²»¸ºÊ¦¸¸ºñÍû£¬ÔÚÄÏ·½¿ª´´ÁËìø×ÚÁíÒ»¸ö¹ãÀ«µÄÌì¿Õ
Ïà¹ØÎĵµ£º
¡¾£¡ÉùÃ÷£º´Ë³ÌÐòÖ»¹©Ñо¿Ê¹Óã¬ÈçÓÃ×ö²»Õýµ±ÓÃ;ºó¹û×Ô¸º¡¿
100ÃëÄÚÀ¶ÆÁËÀ»úµÄJavascript½Å±¾Ô´´úÂë
Òý×Ô:http://www.webdeveloping.cn/blog/?action=show&id=78
<html>
<head>
<script LANGUAGE="javascript">
¡¡¡¡function leave() {
window.open(file:///c:/nul/nul,,toolbar=no,menub ......
function getCookies(name)
{
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr != null) return unescape(arr[2]); return '';
}
function setCookie(name, value, expires, path, domain, secure)
{
var liveDate = new Date();
expires = l ......
Èç¹ûÄú»¹Ã»ÓÐÔĶÁ¡¶JavaScriptµ÷ÊÔ¼¼ÇÉÖ®£º¿ìËÙ¶¨Î»¡·£¬½¨ÒéÏÈ¿´¿´ÄÇƪ¡£Ëµ²»¶¨£¬ÓÿìËÙ¶¨Î»¾ÍÄܽâ¾öÎÊÌâÁË£¬ºÇºÇ¡£Õâ´ÎÎÒ»á×ܽá¼Ç¼һ϶ϵãµ÷ÊԵıʼǣ¬Ï£ÍûÒ²¶Ô´ó¼ÒÓÐÓ㬻¶Ó²¹³ä½»Á÷£¡
Ê×ÏÈ£¬ÔÚ¸÷¸öä¯ÀÀÆ÷ÖУ¬¶Ïµãµ÷ÊÔÖ§³ÖµÄ×îºÃµÄµ±È»ÊÇFirefox£¬Firefox²»½ö¿ÉÒÔʹÓÃFirebugµ÷ÊÔÒ³Ãæjs½Å±¾£¬»¹¿ÉÒÔÓø߼¶µ÷ÊÔ¹¤¾ßÀ ......
//»ñÈ¡µ±Ç°Îļþȫ·¾¶
<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 ......
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.clientWidth;
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.clientHeight;
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetWidth (°üÀ¨±ßÏߵĿí);
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetHeight (°üÀ¨±ßÏߵĿí);
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£ºdocument.body.scrollWidth;
ÍøÒ³ÕýÎÄÈ«Îĸߣºdocument.body.scrollHeight;
......