JavascriptÖ®ä¯ÀÀÆ÷¶ÔÏó
ä¯ÀÀÆ÷¶ÔÏó
ä¯ÀÀÆ÷¶ÔÏó¾ÍÊÇÍøÒ³ºÍä¯ÀÀÆ÷±¾Éí¸÷ÖÖʵÌåÔªËØÔÚJavaScript³ÌÐòÖеÄÌåÏÖ¡£ÕâÑùµÄä¯ÀÀÆ÷¶ÔÏóÖ÷Òª°üÀ¨ÒÔϼ¸¸ö
¡ñ Navigator£º¹ÜÀíÕßµ±Ç°Ê¹ÓÃä¯ÀÀÆ÷µÄ°æ±¾ºÅ¡¢ÔËÐеÄƽ̨ÒÔ¼°ä¯ÀÀÆ÷ʹÓõÄÓïÑÔµÈÐÅÏ¢¡£
¡ñ Windows¶ÔÏ󣺴¦ÓÚÕû¸ö´ÓÊô±íµÄ×¼¶Î»Öá£Ã¿Ò»¸öÕâÑùµÄ¶ÔÏó´ú±íÒ»¸öä¯ÀÀÆ÷´°¿Ú¡£
¡ñ Location¶ÔÏ󣺺¬Óе±Ç°ÍøÒ³µÄURLµØÖ·¡£
¡ñ Document¶ÔÏó£º º¬Óе±Ç°ÍøÒ³µÄ¸÷ÖÖÌØÐÔ£¬ÀýÈç±êÌâ¡¢±³¾°¸ÐÒÔ¼°Ê¹ÓõÄÓïÑԵȡ£
¡ñ History¶ÔÏ󣺺¬ÓÐÒÔÇ°·ÃÎʹýµÄÍøÒ³µÄURLµØÖ·¡£
ʹÓÃä¯ÀÀÆ÷µÄÄÚ²¿¶ÔÏóϵͳ£¬¿ÉʵÏÖÓÚHTMLÎĵµ½øÐн»»¥¡£ËüµÄ×÷ÓÃÊǽ«Ïà¹ØÔªËØ×éÖ¯°ü×°ÆðÀ´£¬Ìṩ¸ø³ÌÐòÉè¼ÆÈËԱʹÓ㬴Ӷø¼õÇá±à³ÌÈ˵ÄÀͶ¯£¬Ìá¸ßÉè¼ÆWebÒ³ÃæµÄÄÜÁ¦¡£
1.Navigator¶ÔÏó
Navigator¶ÔÏóÌṩ¹ØÓÚÕû¸öä¯ÀÀÆ÷»·¾³µÄÐÅÏ¢£¬ä¯ÀÀÆ÷¶ÔÏóNavigatorÖг£ÓõÄÊôÐÔÓÐÈçϼ¸Ï
¡ñ AppName£ºÌṩ×Ö·û´®ÐÎʽµÄä¯ÀÀÆ÷Ãû³Æ¡£ÔÚʹÓÃNavigatorʱ£¬appNameµÄֵΪNetScape£»ÔÚʹÓÃInternet Explorerʱ£¬ appNameµÄֵΪMSIE¡£
¡ñ AppVersion£º ·´Ó³ä¯ÀÀÆ÷µÄ°æ±¾ºÅ¡£
¡ñ AppCodeName£º·´Ó³ÓÃ×Ö·û´®±íʾµÄµ±Ç°ä¯ÀÀÆ÷µÄ´úÂëÃû×Ö¡£¶ÔÓÚNavigatorµÄËùÓа汾£¬Õâ¸öÖµ¶¼ÊÇMozilla¡£
Îļþ·¶Àý£º15-24.htm
Ôڽű¾ÖÐʹÓÃNavigator¶ÔÏó¡£
01 <!-- ------------------------------ -->
02 <!-- Îļþ·¶Àý£º15-24.htm -->
03 <!-- Îļþ˵Ã÷£ºNavagator¶ÔÏó -->
04 <!-- ------------------------------ -->
05 <HTML>
06 <HEAD>
07 <TITLE>Navagator¶ÔÏó</TITLE>
08 </HEAD>
09 <BODY>
10 <script language="javascript">
11 <!--
12 document.write("ÄãʹÓõÄÊÇ"+navigator.appName+"<br>"+navigator.appVersion)
13 -->
14 </Script>
15 </BODY>
16 </HTML>
Îļþ˵Ã÷
µÚ12Ðе÷ÓÃä¯ÀÀÆ÷µÄÃû³ÆºÍ°æ±¾ºÅ¡£
2.Windows¶ÔÏó
´°¿Ú¶ÔÏó°üÀ¨Ðí¶àÓÐÓõÄÊôÐÔ¡¢·½·¨ºÍʼþÇý¶¯³ÌÐò£¬±à³ÌÈËÔ±¿ÉÒÔÀûÓÃÕâЩ¶ÔÏó¿ØÖÆä¯ÀÀÆ÷´°¿ÚÏÔʾµÄ¸÷¸ö·½Ã棬Èç¶Ô»°¿ò¡¢¿ò¼ÜµÈ¡£
ÏÂÃæÁгöһЩ³£ÓÃWindows¶ÔÏóµÄ·½·¨¡£
¡ñ open£¨URL£¬windowName£¬parameterList£©£ºopen·½·¨´´½¨Ò»¸öä¯ÀÀÆ÷´°¿Ú£¬²¢ÔÚд°¿ÚÖÐÔØÈëÒ»¸öÖ¸¶¨µÄURLµØÖ·
Ïà¹ØÎĵµ£º
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture();
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x
event.y
´°Ìå ......
¢Ùfunction doDelete(){
var deleteArray = new Array();
var cnt = 0;
for (i = 0; i < document.forms[0].elements.length; i++ ) {
// ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤¬ON¤Î時¤Ï¤½¤Î値¤ò設¶¨¤¹¤ë¡£
......
ÓÃÁ˺ܾÃJavaScript£¬¶Ô¡¾this¡¿µÄÈÏʶֻ¾ÖÏÞÓÚÒÔÍùµÄƾ¾Ñé¶øÒÑ£¬²»¹ý½ñÌì·¢ÏÖÁ˺ö«Î÷“http://www.quirksmode.org/js/associative.html”£¬ÏêϸÃèÊöÁËÈçºÎʹÓá¾this¡¿¹Ø¼ü×Ö£¬ÔÚÕâÀïÎҾͼò¶ÌµÄ˵һÏÂÖص㣬Èç¹ûÓÐÒÉÎÊ¿ÉÒÔÖ±½Ó²Î¿¼ÔÎÄ¡£
ÔÚѧϰ¹ýÓÐthisµÄ±à³ÌÓïÑÔÖУ¬thisÒ»°ã¶¼ÊÇÖ¸Ïòµ±Ç°ÊµÀý¶ÔÏóµÄ£¬¶ÔÓ ......
stringObject.substring(start,end);
º¯Êý·½·¨½«·µ»ØÒ»¸ö°üº¬´Ó start µ½×îºó£¨²»°üº¬ end £©µÄ×Ó×Ö·û´®µÄ×Ö·û´®.
start ±ØÐè¡£Ò»¸ö·Ç¸ºµÄÕûÊý£¬¹æ¶¨ÒªÌáÈ¡µÄ×Ó´®µÄµÚÒ»¸ö×Ö·ûÔÚ stringObject ÖеÄλÖÃ.
stop ¿ÉÑ¡¡£Ò»¸ö·Ç¸ºµÄÕûÊý£¬±ÈÒªÌáÈ¡µÄ×Ó´®µÄ×îºóÒ»¸ö×Ö·ûÔÚ stringObject ......
¾³£ÔÚie6ϳöÏÖjavascriptÒ³ÃæÌøתºÍ±íµ¥Ìá½»ÎÊÌ⣬ie6ÏÂʵÏÖjavascriptÒ³ÃæÌøתºÍ±íµ¥Ìá½»ÐèÒª½øÐÐÌرð´¦Àí£¬ÐèҪʹÓÃsetTimeout()º¯ÊýÑÓ³ÙʵÏÖ¡£
1£¬¼æÈݸ÷ä¯ÀÀÆ÷µÄJavascriptÒ³ÃæÌøת
setTimeout(function(){
window.location.href = url;
},0);
2£¬¼æÈݸ÷ä¯ÀÀÆ÷µÄJavascript±íµ¥Ìá½»
setTimeout(function ......