JavaScript¾ÍÕâô»ØÊ (JS»ù´¡ÖªÊ¶ÕûÀí)
JavaScript¾ÍÕâô»ØÊ (JS»ù´¡ÖªÊ¶ÕûÀí)
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() +
Ïà¹ØÎĵµ£º
JavaScript ¿ò¼Ü±È½Ï
ÏÔÖøÔöÇ¿ JavaScript ¿ª·¢µÄ¿ò¼Ü¸ÅÀÀ
Joe Lennon, Èí¼þ¿ª·¢ÈËÔ±, ×ÔÓÉÖ°ÒµÕß
¼ò½é£º ÏÖ´ú Web Õ¾µãºÍ Web Ó¦ÓóÌÐòÇãÏòÓÚÒÀÀµ´óÁ¿¿Í»§¶Ë JavaScript À´Ìṩ·á¸»µÄ½»»¥¹¦ÄÜ£¬ÓÈÆäÊÇÒì²½ HTTP ÇëÇóµÄ³öÏÖʹµÃ²»Ë¢ÐÂÒ³Ãæ¾Í¿ÉÒÔ´Ó·þÎñÆ÷¶Ë½Å±¾»òÊý¾Ý¿âϵͳ·µ»ØÊý¾Ý»òÏìÓ¦¡£ÔÚ±¾ÎÄÖУ¬Äú½«Á˽âÈçº ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......
srcElement ÊÇDomʼþÖеÄʼþ×î³õÖ¸Åɵ½µÄÔªËØ¡£
±ÈÈçÓÐÒ»¸ödiv£¬ÀïÃæÓÐÒ»¸ö°´Å¥¡£ÄãÏìÓ¦divµÄonclickʼþ£¬µ«Êµ¼ÊÉÏ£¬Äãµ¥»÷µÄÖ»ÊÇËüÄÚ²¿µÄ°´Å¥£¬ÄÇô£¬srcElementÖ¸ÏòµÄ£¬¾ÍÊÇÄǸö°´Å¥¡£
srcElementÖ»ÔÚIEÖÐÓÐЧ¡£
ÔÚOperaϵÁÐä¯ÀÀÆ÷ÖжÔÓ¦µÄÊôÐÔÊÇtarget
¸øÄãÒ»¸öIEÏÂʹÓõÄÀý×Ó¡£
<!DOCTYPE html PUBLIC "-//W ......
// ±£´æCookie
function saveCookie(name, value, expires, path, domain, secure){
var strCookie = name +& ......
<input type="text" onblur="if (value ==''){value='ÇëÊäÈë¹Ø¼ü×Ö'}" onfocus="if (value =='ÇëÊäÈë¹Ø¼ü×Ö'){value =''}" id="q" name="q" value="ÇëÊäÈë¹Ø¼ü×Ö" style="width: 100px; height: 14px;">
......