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

JavaScriptÄ£ÄâÓû§µ¥»÷ʼþ

¹«Ë¾ÏîÄ¿ÏëҪʵÏÖÒ»ÖÖ¹¦ÄÜ£º
µ¥»÷Ò»¸ö°´Å¥»ò³¬Á´½Ó£¬È»ºó»á³öÏÖÆäËûµÄ³¬Á´½Ó£¬ÕâʱҪÈÃÆäÖеÄÒ»¸ö³¬Á´½Ó±»µ¥»÷£¬ÒÔÏÔʾһ¸ö³õʼҳÃæ¡££¨¹«Ë¾Ò³ÃæʹÓÃÁËframeset£©
ºÜÏÔÈ»£¬Ö®ºóµÄ³¬Á´½Óµ¥»÷ʼþÐèҪͨ¹ýJavaScriptÀ´´¥·¢¡£
Ò»¿ªÊ¼£¬ÎÒÏëµ½ÁËÓÃjQueryµÄclick()ʼþÀ´´¥·¢³¬Á´½ÓµÄµ¥»÷ʼþ£¨Óëtrigger("click")Ò»ÑùµÄЧ¹û£©¡£½á¹û·¢ÏÖ²»ÈçÈËÒâ¡£
ʵÀýÈçÏ£º
Ч¹ûͼ
IE:
FireFox:
<h3>Çëµ¥»÷”Click Me"¡£²âÊÔÌá½»°´Å¥Ó볬Á´½ÓÊÇ·ñÒ²±»µ¥»÷ÁË¡£</h3>
<button id="btn">Click Me</button>
<form action="#">
<input type="text" name="userName" value="Ðìлª-polaris" readonly/>
<input id="submit" type="submit" value="±ðµã»÷´Ë°´Å¥Ìá½»" onclick="alert('´¥·¢ÁËÌá½»°´Å¥µÄµ¥»÷ʼþ£¡');"/>
</form>
<a id="aLink" href="http://www.google.cn" mce_href="http://www.google.cn" onclick = "alert('´¥·¢Á˳¬Á´½ÓµÄµ¥»÷ʼþ£¡');">´úÂë´¥·¢³¬Á´½Ó</a>

<h3>Çëµ¥»÷”Click Me"¡£²âÊÔÌá½»°´Å¥Ó볬Á´½ÓÊÇ·ñÒ²±»µ¥»÷ÁË¡£</h3>
<button id="btn">Click Me</button>
<form action="#">
<input type="text" name="userName" value="Ðìлª-polaris" readonly/>
<input id="submit" type="submit" value="±ðµã»÷´Ë°´Å¥Ìá½»" onclick="alert('´¥·¢ÁËÌá½»°´Å¥µÄµ¥»÷ʼþ£¡');"/>
</form>
<a id="aLink" href="http://www.google.cn" onclick = "alert('´¥·¢Á˳¬Á´½ÓµÄµ¥»÷ʼþ£¡');">´úÂë´¥·¢³¬Á´½Ó</a>
$(function()
{
$("#btn").click(function()
{
$("#submit").click();
$("#aLink").click();
});
});

µ±µ¥»÷£ºClick
Me°´Å¥Ê±£¬ÏȺ󵯳öÌá½»°´Å¥±»µ¥»÷¡¢³¬Á´½Ó±»µ¥»÷µÄ¶Ô»°¿ò£¬Õâ±íÃ÷Á½Õߵĵ¥»÷ʼþ¶¼±»´¥·¢ÁË¡£È»¶ø£¬´ÓµØÖ·À¸ÖпÉÒÔ¿´µ½£¬Ìá½»°´Å¥µÄµ¥»÷ʼþ´¥·¢ºó£¬Ö´
ÐÐÁËËüµÄĬÈÏÐÐΪ£ºÌá½»±íµ¥£»¿ÉÊdz¬Á´½ÓµÄµ¥»÷ʼþ´¥·¢ºó£


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

JavaScriptÑéÖ¤´óÈ«

jsÑéÖ¤±íµ¥´óÈ«
1. ³¤¶ÈÏÞÖÆ
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("²»Äܳ¬¹ý50¸ö×Ö·û£¡");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"&g ......

IEºÍFirefoxÔÚcss,JavaScript·½ÃæµÄ¼æÈÝÐÔ

1.document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements["elementName"];FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃ() ......

javascript¸ÐÑÔ

                                                    ......

JavaScript »ù´¡¼¼ÇÉ(1)

1£º»ù´¡ÖªÊ¶
1 ´´½¨½Å±¾¿é
<script language=”JavaScript”>
        JavaScript code goes here
</script>
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(“Hello&rdqu ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ