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

javascript ¼üÅÌʼþ×ܽá


ÔÚ½øÈëÕýÌâÇ°£¬ÎÒÃÇ¿´Ò»ÏÂä¯ÀÀÆ÷¶ÔÓÚ¼üÅ̵ÄһЩĬÈÏʼþ£¬ÕâÓÐÖúÓÚÎÒÃÇÓÃjavascript½Ø»ñ¼üÅÌʼþ¡£
ÔÚformÖУ¬ submitµÄ¿ì½Ý¼üÊÇ enter£¬resetµÄ¿ì½Ý¼üÊÇ esc¡£²»¹ýÔÚ
IE6,safari4,ff3.5,opera10,chromeÖÐ
£¬°´Enter£¬²»µ«¼¤·¢formµÄsubmitʼþ£¬Í¬Ê±Ò²»á¼¤·¢
Ìá½»°´Å¥µÄonclick£¬¼¤·¢Ë³ÐòΪÌá½»°´Å¥µÄ onclick →¡¡form µÄ onsubmit¡£
<html
dir="ltr" lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>¼üÅÌʼþ</title>
</head>
<body>
<h3>¼üÅÌʼþ</h3>
<form onsubmit="alert('Form is submiting');return false;">
<p><input type="text" value="½«½¹µã¾Û½¹ÓÚÎı¾ÓòÖУ¬È»ºó°´»Ø³µ¼ü»òEsc¼ü"
/></p>
<p><input type="submit" onclick="alert('submit button is
clicked');" value="submit"/>
<input type="reset" onclick="alert('reset button is clicked');"
value="reset" />
</p>
</form>
</body>
</html>

ÔËÐдúÂë
²»¹ý²¢²»Ö¹Ìá½»°´Å¥»á¼¤·¢formµÄsubmitʼþ£¬Á¬Í¬ÉÏÃæµÄ¹éÄÉÈçÏ£º
Èç¹û±íµ¥ÀïÓÐÒ»¸ötype="submit"µÄ°´Å¥£¬»Ø³µ¼üÉúЧ¡£
Èç¹û±íµ¥ÀïÖ»ÓÐÒ»¸ötype="text"µÄinput£¬²»¹Ü°´Å¥ÊÇʲôtype£¬»Ø³µ¼üÉúЧ¡£
Èç¹û°´Å¥²»ÊÇÓÃinput£¬¶øÊÇÓÃbutton£¬²¢ÇÒûÓмÓtype£¬IEÏÂĬÈÏΪtype=button£¬FXĬÈÏΪ
type=submit¡£
ÆäËû±íµ¥ÔªËØÈçtextarea¡¢select²»Ó°Ï죬radio
checkbox²»Ó°Ïì´¥·¢¹æÔò£¬µ«±¾ÉíÔÚFXÏ»áÏìÓ¦»Ø³µ¼ü£¬ÔÚIEϲ»ÏìÓ¦¡£
type="image"µÄinput£¬Ð§¹ûµÈͬÓÚtype="submit"¡£²»ÖªµÀΪʲô»áÉè¼ÆÕâÑùÒ»ÖÖtype£¬²»ÍƼöʹÓã¬Ó¦¸Ã
ÓÃCSSÌí¼Ó±³¾°Í¼ºÏÊÊЩ¡£
³ýÁËÔÚ°´Å¥Öа󶨼üÅÌʼþÍ⣬ä¯ÀÀÆ÷»¹ÓÐÒ»¸öaccesskey ÊôÐÔÀ´Ö¸¶¨Á´½ÓµÄ¿ì½Ý¼ü¡£×¢Òâ accesskey
µÄÉèÖÃÈç¹ûºÍä¯ÀÀÆ÷µÄ²Ëµ¥Ïàͬ£¬»áÓÅÏÈÓڲ˵¥¡£ÔÚIEÖУ¬¿ì½Ý¼üÊÇ alt + ÉèÖõļüÖµ£¬FFÊÇAlt+Shift+ ÉèÖõļüÖµ¡£ ÔÚIE
ÖУ¬aÔªËØµÄ accesskey Ö»ÊÇʹ½¹µãתÒƵ½Á´½ÓÉÏ£¬²¢²»µÈͬÓÚµã»÷£¬FF ÖÐÔòÏ൱ÓÚµã»÷¡£ÓëËû¶Ô±ÈµÄÊÇ£¬input


Ïà¹ØÎĵµ£º

JavaScriptÖеÄJSON

 
JavaScriptÖеÄJSON
 
JavaScriptÊÇΪÍø¾°ä¯ÀÀÆ÷×öÒ³Ãæ½Å±¾ÓïÑÔ¶øʵÏÖµÄÒ»ÖÖ±à³ÌÓïÑÔ¡£ËüÏÖÔÚ»¹±»ºÜ¶àÈËÎó½âÊÇjavaµÄ×Ó¼¯¡£ËüÊÇÒ»ÖÖ¾ßÓÐÀàCÓï·¨ºÍÈõ¶ÔÏóµÄģʽÓïÑÔ¡£JavaScriptÍêÈ«×ñÊØECMAScriptÓïÑÔ˵Ã÷ÊéµÚÈý°æ¡£
JSONÊÇJavaScript¶ÔÏóÎÄ×ּǺŵÄ×Ó¼¯¡£ÓÉÓÚJSONÊÇJavaSriptµÄ×Ó¼¯£¬ËùÒÔÔÚJavaScriptÀ ......

asp.net×¢²áJavascriptµÄ·½·¨

1¡¢IsStartupScriptRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁËÆôÓýű¾¡£
2¡¢IsClientScriptBlockRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁË¿Í»§¶Ë½Å±¾¿é¡£
3¡¢IsClientScriptIncludeRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁË¿Í»§¶Ë½Å±¾°üº¬¡£
µÚÒ»¸öÀý×Ó£º
string info = "<script>alert('ÄãºÃÂð£¿');</script>";
//ÅжÏʼþÊÇ·ñ±»×¢²á£¬Ð´ÈëÇ ......

JavaScript ÖÐÎÄÂÒÂë½â¾ö·½·¨

·¢ËÍÖÐÎÄ×Ö·ûÇëÇóʱ£¬Èç¹ûʹÓÃget·½Ê½£¬ÔËÐÐÕý³££»¶øʹÓÃpost·½·¨Ôò»á³öÏÖÂÒÂë¡£ÕâÊÇÓÉÓÚÒì²½¶ÔÏóXMLHttpRequestÔÚ´¦Àí·µ»ØµÄ
responseTextµÄʱºò£¬ÊÇ°´UTF-8±àÂë½øÐнâÂëµÄ¡£Èç¹ûÄãÔ­À´µÄÍøÒ³±àÂëÊÇgb2312µÄ»°£¬µ±È»»á·¢Éú±àÂëµÄ³åÍ»ÁË£»Èç¹ûÄãÔ­À´µÄÍøÒ³±à
ÂëÊÇutf-8£¬ÄÇô¾Í²»»á³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌâÁË¡£
³öÏÖÁËÖÐÎÄÂÒ ......

JavaScript ÖеÄ==ºÍ===

ÔÚjsÖУ¬Éϴο´µ½Ò»¶Î´úÂë===ÅжÏʹÓÃ3¸ö=ºÅ
ÎÒÄÉÃÆÁË Ò»ÔËÐÐ Õý³£µÄ¡£
ÓÚÊÇν֮Ի£º“ÉñÂë”
ºó²éÔĵÃÖª
==Ö»ÊÇÅжÏÖµÊÇ·ñÏàµÈ
===ÅжÏÖµºÍÀàÐÍÊÇ·ñ¶¼ÏàµÈ
±ÈÈç
var key="222";
var key2=222;
alert(key==key2)//ture
alert(key===key2)//false
²»ÖªµÀÆäËûµÄÈõÀàÐÍÊÇ·ñ¶¼ÊÇÒ»Ñù¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ