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

JavaScript»ñÈ¡µ±Ç°Îļþȫ·¾¶¡¢µ±Ç°Ä¿Â¼¡¢µ±Ç°ÎļþÃû

//»ñÈ¡µ±Ç°Îļþȫ·¾¶
<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);
</script>
//»ñÈ¡µ±Ç°Ä¿Â¼·½·¨
<script type="text/javascript">
//·½·¨Ò»
var str = location.href;
var arr = str.split("/");
delete arr[arr.length-1];
var dir = arr.join("/");
alert(dir);
//·½·¨¶þ
alert(location.href.substring(0,location.href.lastIndexOf('/')));
</script>
//»ñÈ¡µ±Ç°ÎļþÃû
<script   language=javascript>   
var  filename=location.href;
filename=filename.substr(filename.lastIndexOf('/')+1);   
alert(filename);   
</script>


Ïà¹ØÎĵµ£º

javaScript¼ò½é


ÔÚÊý°ÙÍòÕÅÒ³ÃæÖУ¬JavaScript ±»ÓÃÀ´¸Ä½øÉè¼Æ¡¢ÑéÖ¤±íµ¥¡¢¼ì²âä¯ÀÀÆ÷¡¢´´½¨cookies£¬µÈµÈµÈµÈ¡£
JavaScript ÊÇÒòÌØÍøÉÏ×îÁ÷ÐеĽű¾ÓïÑÔ£¬²¢ÇÒ¿ÉÔÚËùÓÐÖ÷ÒªµÄä¯ÀÀÆ÷ÖÐÔËÐУ¬±È·½Ëµ Internet
Explorer¡¢ Mozilla¡¢Firefox¡¢Netscape¡¢ºÍ Opera¡£
            ......

JavaScriptµ÷ÊÔ¼¼ÇÉÖ®£º¶Ïµãµ÷ÊÔ(1)


Èç¹ûÄú»¹Ã»ÓÐÔĶÁ¡¶JavaScriptµ÷ÊÔ¼¼ÇÉÖ®£º¿ìËÙ¶¨Î»¡·£¬½¨ÒéÏÈ¿´¿´ÄÇƪ¡£Ëµ²»¶¨£¬ÓÿìËÙ¶¨Î»¾ÍÄܽâ¾öÎÊÌâÁË£¬ºÇºÇ¡£Õâ´ÎÎÒ»á×ܽá¼Ç¼һ϶ϵãµ÷ÊԵıʼǣ¬Ï£ÍûÒ²¶Ô´ó¼ÒÓÐÓ㬻¶Ó­²¹³ä½»Á÷£¡
Ê×ÏÈ£¬ÔÚ¸÷¸öä¯ÀÀÆ÷ÖУ¬¶Ïµãµ÷ÊÔÖ§³ÖµÄ×îºÃµÄµ±È»ÊÇFirefox£¬Firefox²»½ö¿ÉÒÔʹÓÃFirebugµ÷ÊÔÒ³Ãæjs½Å±¾£¬»¹¿ÉÒÔÓø߼¶µ÷ÊÔ¹¤¾ßÀ ......

JavaScriptÖÐÄäÃûº¯Êý£¬º¯ÊýÖ±½ÓÁ¿ºÍ±Õ°ü(ת)

Ô­Îijö´¦: http://www.dnew.cn/post/196.htm
ÏÈ¿´ÏÂÏÂÃ漸ÖÖд·¨
1.function f(x){return x*x;};f(x);
2.(function(x){return x*x;})(x);
3.(function(x){return x*x;}(x));
µÚÒ»ÖÖÎÒÃÇÓ¦¸Ã¶¼ºÜÊìϤÁË£¬ÕâÊÇÎÒÃǾ­³£Ê¹ÓõÄд·¨¡£µÚ¶þµÚÈýÖÖ¶¼ÊÇÄäÃûº¯ÊýµÄд·¨¡£
------------------------------------------------ ......

JavaScript ÕýÔò±í´ïʽÁ½ÖÖʹÓ÷½Ê½µÄÇø±ð


¹ØÓÚ
JavaScript
ÕýÔò±í´ï¶ÔÏóµÄʹÓã¬Æä²Î¿¼ÊÖ²á½éÉÜÈçÏ£º
Óï·¨ 1
re = /
pattern
/
[flags
]
Óï·¨ 2
re = new RegExp("
pattern
",
["
flags
"
])
²ÎÊý
re
±ØÑ¡Ïî¡£½«Òª¸³ÖµÎªÕýÔò±í´ïʽģʽµÄ±äÁ¿Ãû¡£
Pattern
±ØÑ¡ÏҪʹÓõÄÕýÔò±í´ïʽģʽ¡£Èç¹ûʹÓÃÓï·¨ 1
£¬Óà &q ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ