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

javascriptË«ÒýºÅתÒå

http://www.cnblogs.com/yzx99/archive/2008/08/08/1263416.html
µ¥ÒýºÅ,Ë«ÒýºÅ,javascript,HTML,תÒå×Ö·û
ÔÚÒ»¸öÍøÒ³Öеİ´Å¥£¬Ð´onclickʼþµÄ´¦Àí´úÂ룬²»Ð¡ÐÄд³ÉÈçÏ£º
<input value="Test" type="button" onclick="alert(""OK"");" />
IEÌáʾ³ö´íºó£¬ÔÙÂþ²»¾­ÐĵظÄΪ£º
<input value="Test" type="button" onclick="alert(\"OK\");" />
½á¹û»¹Êdzö´í¡£
Õâʱ£¬ÎÒ¾ÍÏ벻ͨÁË£¬ËäÈ»ÎÒÖªµÀ×îÖ±½ÓµÄ½â¾ö·½·¨ÊÇд³ÉÕâÑù£º
<input value="" type="button" onclick="alert('OK');" />
µ«ÎªÊ²Ã´javascriptÖеÄתÒå×Ö·û\ûÓÐЧ¹ûÁËÄØ£¿
ºóÀ´ÕÒµ½Ò»¶ÎÕý³£µÄ´úÂ룺
<input value="Test" type="button" onclick="alert(&quot;OK&quot;);" />
Õâʱ²ÅÀí½â£¬Ô­À´Õâʱ£¬»¹ÊǹéÓÚHTMLµÄ¹ÜϽ·¶Î§£¬ËùÒÔתÒå×Ö·ûÓ¦¸ÃʹÓÃHTMLµÄ£¬¶ø²»ÊÇjavascriptµÄ¡£Á½¸öË«ÒýºÅµÄ×ö·¨ÊÇvbScriptµÄ£¬\"ÕâÖÖ×ö·¨ÔòÊÇjavascriptµÄ£¬¶øHTMLµÄ£¬ÔòÊÇÓÃ&quot;£¬´ËÍ⻹¿ÉÒÔʹÓãº"¡¢&#x27¡£
ÏÂÃæÁгö¸÷ÖÖ±í´ï·½·¨£º
<html>
<body>
<input value="ÍâË«ÒýºÅÄÚË«ÒýºÅ-´íÎó" type="button" onclick="alert("OK");" /><br />
<input value="Íâµ¥ÒýºÅÄÚµ¥ÒýºÅ-´íÎó" type="button" onclick='alert('OK');' /><br />
<input value="Á½¸öË«ÒýºÅ-´íÎó" type="button" onclick="alert(""OK"");" /><br />
<input value="Á½¸öµ¥ÒýºÅ-´íÎó" type="button" onclick="alert(''OK'');" /><br />
<input value="\+Ë«ÒýºÅ-´íÎó" type="button" onclick="alert(\"OK\");" /><br />
<input value="\+µ¥ÒýºÅ-´íÎó" type="button" onclick="alert(\'OK\');" /><br />
<input value="ÍâË«ÒýºÅÄÚµ¥ÒýºÅ-OK" type="button" onclick="alert('OK');" /><br />
<input value="Íâµ¥ÒýºÅÄÚË«ÒýºÅ-OK" type="button" onclick='alert("OK");' /><br />
<input value="Íⲿ²»Ê¹ÓÃÒýºÅ-OK" type="button" onclick=alert('OK');alert("OK"); /><br />
<input value="HTMLתÒå×Ö·û"(& # 3 4 ;)-OK" type="button" onclick="alert("OK");" /><br />
<input value="HTMLתÒå×Ö·û'(& # 3 9 ;)-OK" type="button" onclick="alert('OK');" /><br />
<input value="HTMLתÒå×Ö·û"(& # x 2


Ïà¹ØÎĵµ£º

javascriptÖÐFORM±íµ¥µÄsubmit()·½·¨¾­Ñé½Ìѵ

@author    songfeng     
       ÒòΪJSÄÚ¶ÔÏóµÄ·½·¨Êµ¼ÊÉÏÊÇ´æ´¢Óï¾äµÄÒ»¸öÀàËÆÓÚÖ¸ÕëµÄ¶«Î÷. ÆäÖ¸ÏòÁËÄÚ´æµÄÒ»¸öλÖÃ, Ò²¾ÍÊÇÆ亯ÊýµÄλÖÃ,µ±È»Ò²¿ÉÒÔÈÃÆäÖ¸ÏòÒ»¸ö±äÁ¿Öµ.
       var foo = new Object();
&nbs ......

ÉîÈëÀí½âJavascript±Õ°ü(closure)

×î½üÔÚÍøÉϲéÔÄÁ˲»ÉÙJavascript±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
Ò»¡¢Ê²Ã´ÊDZհü£¿
“¹Ù·½”µÄ½âÊÍÊÇ£ºËùν“±Õ°ü”£¬Ö¸µÄÊÇÒ»¸öÓµÓÐÐí¶à±äÁ¿ºÍ°ó¶¨Á ......

javascript ´¥·¢Ê¼þÁбí


Ò»°ãʼþ
ʼþä¯ÀÀÆ÷Ö§³ÖÃèÊö
onClick
HTML: 2 | 3 | 3.2 | 4 
Browser: IE3 | N2 | O3 
Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick
HTML: 2 | 3 | 3.2 | 4 
Browser: IE4 |&nb ......

javascriptÖ®getAttribute()·½·¨

getAttribute()·½·¨
 ¡ñÒ»·ÝÎĵµ¾ÍÊÇÒ»¿Ã½ÚµãÊ÷¡£
  ¡ñ½Úµã·ÖΪ²»Í¬µÄÀàÐÍ£ºÔªËؽڵ㡢ÊôÐÔ½ÚµãºÍÎı¾½ÚµãµÈ¡£
  ¡ñgetElementById()·½·¨½«·µ»ØÒ»¸ö¶ÔÏ󣬸öÔÏó¶ÔÓ¦×ÅÎĵµÀïµÄÒ»¸öÌض¨µÄÔªËؽڵ㡣
  ¡ñgetElementsByTagName()·½·¨½«·µ»ØÒ»¸ö¶ÔÏóÊý×飬ËüÃÇ·Ö±ð¶ÔÓ¦×ÅÎĵµÀïµÄÒ»¸ ......

JavaScript½Ì³Ì ´ÓÈëÃŵ½¾«Í¨

JavaScriptÊÇÓÉNetscape¹«Ë¾¿ª·¢²¢ËæNavigatorµ¼º½ÕßÒ»Æð·¢²¼µÄ¡¢½éÓÚJava
ÓëHTMLÖ®¼ä¡¢»ùÓÚ¶ÔÏóʼþÇý¶¯µÄ±à³ÌÓïÑÔ£¬ÕýÈÕÒæÊܵ½È«ÇòµÄ¹Ø×¢¡£ÒòËüµÄ¿ª·¢»·¾³¼òµ¥£¬²»ÐèÒªJava±àÒëÆ÷£¬¶øÊÇÖ±½ÓÔËÐÐÔÚWebä¯ÀÀÆ÷ÖУ¬¶øÒò±¶
ÊÜWebÉè¼ÆÕßµÄËù°®¡£
ÕâÒ»Ì×JavaScript½Ì³Ì·Ö¾Å¸öÕ½ڴÓʲôÊÇJavaScript¡¢JavaScriptµÄ¼òµ¥Ó¦ÓÃÒ»Ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ