javascript£º°´»Ø³µÏàÓ¦°´Å¥Ìύʼþ
ÔÚ±íµ¥Ìύǰ¾³£Óöµ½±íµ¥ÑéÖ¤ÎÊÌâ¶ø³£Óõķ½·¨ÓÐÒÔÏÂÁ½ÖÖ£º
1¡¢Ê¹ÓÃÌá½»°´Å¥Ìá½»£¬ÔÚform±íµ¥ÖеÄonsubmitʼþ½øÐÐ±íµ¥ÑéÖ¤£º
<script type="text/javascript">
function onSub(){
//±íµ¥ÑéÖ¤´úÂë
}
</script>
<form action="" method="" onsubmit="javascript:onSub();">
2¡¢Ê¹ÓÃbutton»òͼƬµÄonclickʼþµ÷ÓÃ±íµ¥ÑéÖ¤´úÂ룺
<input type="button" name="button" id="button" onclick="javascript:onSub();" />
<img src="ͼƬ·¾¶" onclick="javascript:onSub();" />
µ«ÊÇ£¬Ê¹ÓõڶþÖÖ·½Ê½½øÐÐÌá½»±íµ¥Ê±£¬²»ÄÜÔÚÌîдÍê±íµ¥Ê±,°´»Ø³µ²»ÄÜÌá½»±íµ¥¡£Õâ¸ø¿Í»§µÄ
¸ÐÊÜÊǺÍÖ±½ÓʹÓÃÌá½»°´Å¥Ìá½»±íµ¥ÊDz»Í¬µÄ£»ÎªÁËʵÏÖ´ËÏÄÜÖ»ÐèÔÚÄãµÄÒ³Ãæ¼ÓÉÏÈçÏÂjavascript´úÂë¼´¿É
function butOnClick() {
if (event.keyCode == 13) {
var button = document.getElementById("bsubmit"); //bsubmit Ϊbotton°´Å¥µÄid
button.click();
return false;
}
}
ÔÚÄã±íµ¥×îÓÐÒ»¸öÊäÈëÏîÖгö·¢onkeydo
Ïà¹ØÎĵµ£º
½ñÌìµÄ»°ÌâÊÇÈçºÎ¸Ä½ø×Ô¼ºÍøÕ¾µÄ½çÃæ»òÌá¸ßÍøÕ¾µÄÊÓ¾õÌåÑ飬´Ó¶øÈÃÓû§¼ÇÒäÓÌС£
¡¡¡¡ÎÒÃÇÓÐÈýÖÖÖ÷ÒªµÄ·½·¨(´ÓÄѵ½Ò×):×Ô¼º¶¯ÊÖд½Å±¾;ʹÓÃÀàËÆÓÚjQueryºÍmooToolsµÄJavaScript¿ò¼Ü(¿ÉÒÔÈñàд´úÂë±äµÃ¸üÈÝÒ×Щ);ʹÓÃÄܹ¤×÷ÓÚÏÖÓеÄJavaScript¿ò¼ÜϵÄÌáÇ°Ô¤ÖúõĽű¾»òÄÇÖÖ´ÓÍ·¿ªÊ¼¿ª·¢µÄ´´½¨Õß¡£ÕâƪÎÄÕÂÊʺÏÄÇ ......
±¾ÎÄÀ´×Ô£º
http://articles.sitepoint.com/article/adobe-air-pref-javascript
ÔÚÎÒ Ö®Ç°µÄÌû×ÓÀ ÎÒ¼¤¶¯µØ¿ªÊ¼ÁËÎҵĵÚÒ»¸öAIRÓ¦Ó㬽Ð×öHarpoon, ½öʹÓÃHTML, CSS, ºÍJavaScript¡£ÎÒµ±Ê±Ã»Ê±¼äÌÖÂÛµÄÒ»¸öÌصã¾ÍÊÇ£¬Äã¿ÉÒÔʹÓÃÒ»¸öXMLÎļþ´æ´¢ºÍ¼ìË÷Ó¦ÓóÌÐòÊ×Ñ¡Ïî¡£
......
½ñÌìÁ˽âÁËÒ»µãjavascriptµÄ»ù´¡£¬¼ÇÏÂÀ´¹©ºóÐøѧϰ·ÔÄ£º
Êý¾ÝÀàÐ͵ÄÅжϣºtypeof£¨var param£© ÅжϱäµÃÊý¾ÝÀàÐÍ
ä¯ÀÀÆ÷ÒÔ¼°²Ù×÷ϵͳµÄÅбð±äÁ¿ navigator.userAgent navigator.platform
var sUserAgent = navigator.userAgent;
//¼ì²âOpera¡¢KHTML
var isOpera = sUserAgent.indexOf(" ......
JavascriptÖÐ×î³£ÓõÄ55¸ö¾µä¼¼ÇÉ ÊÕ²Ø
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ ......