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

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

1£º»ù´¡ÖªÊ¶
1 ´´½¨½Å±¾¿é
<script language=”JavaScript”>
        JavaScript code goes here
</script>
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(“Hello”);
4: // -->
5: </script>
ÔÚ²»Ö§³ÖJavaScriptµÄä¯ÀÀÆ÷Öн«²»Ö´ÐÐÏà¹Ø´úÂë
3 ä¯ÀÀÆ÷²»Ö§³ÖµÄʱºòÏÔʾ
1: <noscript>
2: Hello to the non-JavaScript browser.
3: </noscript>
4 Á´½ÓÍⲿ½Å±¾Îļþ
1: <script language=”JavaScript” src="/”filename.js"”></script>
5 ×¢Êͽű¾
1: // This is a comment
2: document.write(“Hello”); // This is a comment
3: /*
4: All of this
5: is a comment
6: */
6 Êä³öµ½ä¯ÀÀÆ÷
1: document.write(“<strong>Hello</strong>”);
7 ¶¨Òå±äÁ¿
1: var myVariable 
oman';">= “some value”;
8 ×Ö·û´®Ïà¼Ó
1: var myString = “String1” + “String2”;
9 ×Ö·û´®ËÑË÷
1: <script language=”JavaScript”>
2: <!--
3: var myVariable = “Hello there”;
4: var therePlace = myVariable.search(“there”);
5: document.write(therePlace);
6: // -->
7: </script>
10 ×Ö·û´®Ìæ»»
1: thisVar.replace(“Monday”,”Friday”);
11 ¸ñʽ»¯×Ö´®
1: <script language=”JavaScript”>
2: <!--
3: var myVariable = “Hello there”;
4: document.write(myVariable.big() + “<br/>”);
5: document.write(myVariable.blink() + “<br/>”);
6: document.write(myVariable.bold() + “<br/>”);
7: document.write(myVariable.fixed() + “<br


Ïà¹ØÎĵµ£º

JavaScriptÌØЧ£ºÊ±¼äµ¹Êý

var Tid;
var SetTime=4*60*60*1000;  //ÉèÖúÁÃëÊý£¬1000ºÁÃëΪ1Ãë
function LTime(){
    var MyDiv=document.getElementById("mydiv");
    var Time,TempTime,Days,Hours,Minutes,Seconds;
    
  &n ......

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 ......

javascriptµÄdocument¶ÔÏóÏê½â(ת)

document Îĵ²¶ÔÏó - JavaScript½Å±¾ÓïÑÔÃèÊö
---------------------------------------------------------------------
×¢:Ò³ÃæÉÏÔªËØnameÊôÐÔºÍJavaScriptÒýÓõÄÃû³Æ±ØÐëÒ»Ö°üÀ¨´óСд
   ·ñÔò»áÌáʾÄãÒ»¸ö´íÎóÐÅÏ¢ "ÒýÓõÄÔªËØΪ¿Õ»òÕß²»ÊǶÔÏó"
------------------------------------------------------ ......

javascriptÖеıհüÑ­»·±äÁ¿Ö»ÄÜÈ¡×îºóÒ»¸öÖµÎÊÌâ

ÍøÉÏÃæ˵javascript±Õ°üÓÐÁ½µãÐèҪעÒ⣺
1. ±Õ°üÖеĻ·¾³±äÁ¿Èç¹ûÊÇÔÚÑ­»·ÖУ¬ÄÇôʹÓñհü±äÁ¿µÄʱºòÊÇÑ­»·½áÊøºóµÄÖµ
2. ±Õ°ü»·¾³±äÁ¿¿ÉÒÔ¶¨ÒåÔÚ·½·¨ºó£¬²»Ó°ÏìʹÓÃ
µÚ1µãÊÇ˵±Õ°üÀï»·¾³±äÁ¿Èç¹ûÊÇÔÚÑ­»·ÖУ¬ÄÇÖ»ÄÜÈ¡Ñ­»·½áÊøºóµÄÖµ
Õâ¸öÎÊÌâ¿ÉÒÔÓÃevalº¯Êý¼òµ¥½â¾ö£¬ÔÚÑ­»·ÖÐÓÃevalÖ´Ðбհüº¯ÊýÓï¾ä¾ÍûÎÊÌâÀ²£¬Ð§Â ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ