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

JavaScript¾ÍÕâô»ØÊÂ

JavaScript¾ÍÕâô»ØÊÂ1£º»ù´¡ÖªÊ¶
1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </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 = “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/>”);
8: document.write(myVariable.fontcolor(“red”) + “<br/>”);
9: document.write(myVariable.fontsize(“18pt”) + “<br/>”);
10: document.write(myVariable.italics() + “<br/>”);
11: document.write(myVariable.small() + “<br/&g


Ïà¹ØÎĵµ£º

JavaScript ¼¼ÇÉ

JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾ­ÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂÔÓï¾ä
JavaScript ¿ÉÒÔʹÓüòÂÔÓï¾ä¿ìËÙ´´½¨¶ÔÏóºÍÊý× ......

javascript window.onload ´íÎó:ÉÐδʵÏÖ ½â¾ö°ì·¨

window.onload= someFunction();//Ò³Ã汨ÉÐδʵÏÖ´íÎóʱ²»·ÀÓÃÏÂÃæµÄÊÔһϠ  
window.onload = someFunction;    
window.onload = function (){someFunction();};    
window.onload = Function("someFunction();"); ......

[JS]ÄÇЩÏà¼ûºÞÍíµÄ JavaScript ¼¼ÇÉ

http://news.csdn.net/a/20100424/218105.html
JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾ­ÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂÔÓï¾ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ