Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ѧϰ±Ê¼Ç£¨7£© window ¶ÔÏóµÄ4¸öÊôÐÔ

1. document ʵ¼ÊÉÏÊÇ window ¶ÔÏóµÄÊôÐÔ.ÓÃÓÚ·ÃÎÊÎĵµµÄÐÅÏ¢.
    alert(window.document == document); //outputs "true" 
2. location ¶ÔÏóÊÇ window ¶ÔÏóºÍ document ¶ÔÏóµÄÊôÐÔ,ËùÒÔÏÂÃæÁ½¸öÒýÓû¥ÏàµÈ¼Û.ÓÃÓÚ·ÃÎÊURLµÄÐÅÏ¢.
    window.location;
document.location;
3. n ......

JavaScript ²âÊÔ¼°Ð£Ñ鹤¾ß

JavaScript ÊÇÒ»¿îÇ¿´óµÄ¹ã·ºÔËÓÃÓÚÏÖ´úWebÕ¾µã¼°Ó¦ÓõĽű¾ÓïÑÔ¡£×÷Ϊһ¸ö¼¼ÒÕ¾«Õ¿µÄ Web ¿ª·¢Õߣ¬ÕÆÎÕJavaScript¿ÉÒÔÔöÇ¿Óû§µÄʹÓÃÌåÑ飬Ìṩ½»»¥¼°¸»¿Í»§¶ËµÈ¹¦ÄÜ¡£
¾¡¹ÜJavaScript µÄÓï·¨·Ç³£¼òµ¥£¬µ«¶ÔÓÚд³ÌÐò¶øÑÔÈÔÈ»ÊÇÀ§ÄÑÖØÖØ£¬¾ÍÊÇÒòΪËüµÄÔËÐл·¾³£º»ùÓÚWebä¯ÀÀÆ÷¡£
ÒÔÏÂÄú¿ÉÒÔ¿´µ½ÊÕ¼¯µÄ8¸öʵÓÃµÄ JavaScrip ......

JavascriptÈÕÆÚ´¦ÀíÖÐÕýÔòµÄÓ¦ÓÃ


ÕýÔò±í´ïʽÊÇÒ»¸ö·Ç³£·Ç³£·Ç³£Ç¿´óµÄÓïÑÔ£¬ÕâÀïÁ¬ÐøÓÃÁËÈý¸ö·Ç³££¬ÎÒ¾õµÃ»¹²»¹»£¬Ëü½¿Ð¡µ«È´¹¦
ÄÜÇ¿´ó£¬¾ø¶ÔµÄŨËõµÄ¾ÍÊǾ«»ª£¬ÎÒ·¢ÏÖÎÒÔ½À´Ô½Ï²»¶ËüÁË¡£
Õâ¶Îʱ¼ä×öÈÕÆڵĴ¦Àí£¬ÐèÒªÓõ½ÈÕÆڵļÆË㣬°üÀ¨¼Ó¼õʲôµÄ£¬ÓÚÊÇ×öÁËÒ»¸ö¹«Óô¦ÀíµÄÀ©Õ¹£¬½Ð
String.prototype.dateExpression¡£ÒòΪÈÕÆÚ´¦Àí¶¼»áÓõ½±í´ïʽ£¬À ......

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ºÅ