ͨ¹ýJavaScript½øÐÐÑéÖ¤
ʵÀýÈçÏ£ºjavascript.htmlÎļþ
<html>
<head>
<title>JavaScriptÑéÖ¤</title>
</head>
<script language='JavaScript'>
function check()
{
if(form1.text1.value=="") //ÑéÖ¤ÐÕÃûÊÇ·ñΪ¿Õ
{
window.alert("Óû§Ãû²»ÄÜΪ¿Õ£¬ÇëÖØÐÂÊäÈë");
form1.elements(0).focus();
}
else if(form1.text2.value=="") //ÑéÖ¤EmaiÊÇ·ñΪ¿Õ
{
window.alert("Email²»ÄÜΪ¿Õ£¬ÇëÖØÐÂÊäÈë");
form1.elements(1).focus();
}
else if(form1.text2.value.indexOf('@')==-1) //ÑéÖ¤EmaiÊÇ·ñûÓÐ@¶øÊäÈë´íÎó
&n
Ïà¹ØÎĵµ£º
ÏÖÔÚÍøÕ¾»»Æ¤·ôÊDZȽϳ£¼ûµÄ¹¦ÄÜ£¬´ó¶àÊýÂÛ̳¶¼Óеģ¬ÒªÏëʵÏÖÕâÑùЧ¹û¿ÉÒÔ¿´ÈçÏ´úÂ룺Html´úÂ벿·Ö:
1.ÒªÓÐÒ»¸ö´øidµÄÑùʽ±íÁ´½Ó,ÎÒÃÇҪͨ¹ý²Ù×÷Õâ¸öÁ´½ÓÀ´µ÷Óò»Í¬µÄhref.
<link href="css/main0.css" rel="stylesheet" type="text/css" id="cssfile" />
2.Ƥ·ôÑ¡Ôñ°´Å¥(ºǫ́Ϊÿ¸öliÌí¼Óonclickʼþ,´¥·¢»»· ......
<SCRIPT language=javaScript>
<!--
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("Á賿ºÃ!")}
else if (hour < 9){document.write("ÔçÉϺã¡")}
else if (hour < 12){document.write("ÉÏÎçºÃ£¡")}
else if (hour < 14){document.write("ÖÐÎçºÃ£¡")}
else if (hour &l ......
ÔÎÄ£º¡¶Speeding
up JavaScript: Working with the DOM¡·
×÷Õߣº KeeKim Heng, Google Web Developer
ÔÚÎÒÃÇ¿ª·¢»¥ÁªÍø¸»Ó¦Óã¨RIA£©Ê±£¬ÎÒÃǾ³£Ð´Ò»Ð©javascript½Å±¾À´Ð޸ĻòÕßÔö¼ÓÒ³ÃæÔªËØ£¬ÕâЩ¹¤×÷×îÖÕÊÇDOM——»òÕß˵Îĵµ¶ÔÏóÄ£
ÐÍ——À´Íê³ÉµÄ£¬¶øÎÒÃǵÄʵÏÖ·½Ê½»áÓ°Ïìµ½Ó¦ÓõÄÏìÓ¦Ëٶȡ£ ......
ÅжÏä¯ÀÀÆ÷ÀàÐÍ
<SCRIPT language=javascript>
if(navigator.appVersion.indexOf("MSIE 6.") != -1 ){
window.location = "111.htm" ;
}
</SCRIPT>
°´Å¥±³¾°Í¼Æ¬Ìæ»»
<input type=button style="background-image:url(a.gif)" value=test onmouseover="this.style.backgroundImage='url(b.gif ......
ÔÚÊý°ÙÍòÕÅÒ³ÃæÖУ¬JavaScript ±»ÓÃÀ´¸Ä½øÉè¼Æ¡¢ÑéÖ¤±íµ¥¡¢¼ì²âä¯ÀÀÆ÷¡¢´´½¨cookies£¬µÈµÈµÈµÈ¡£
JavaScript ÊÇÒòÌØÍøÉÏ×îÁ÷ÐеĽű¾ÓïÑÔ£¬²¢ÇÒ¿ÉÔÚËùÓÐÖ÷ÒªµÄä¯ÀÀÆ÷ÖÐÔËÐУ¬±È·½Ëµ Internet Explorer¡¢ Mozilla¡¢Firefox¡¢Netscape¡¢ºÍ Opera¡£
ʲôÊÇ JavaScript£¿
JavaScript ±»Éè¼ÆÓÃÀ´Ïò HTML Ò³ÃæÌí¼Ó½»»¥ÐÐΪ¡£ ......