JavaScript³õѧÕßÖ¸ÄÏ
±¾ÎÄÒë×Ô£ºhttp://www.codeproject.com/KB/scripting/jsbeginner.aspx
ÔÎÄ£ºJavaScript For Beginners
ÊÊÒ˶ÔÏó£ºJavaScript³õѧÕß¡£
Ŀ¼£º
°üº¬ÓëÒýÈë(Embedding,including)
write ºÍ writeln
Îĵµ¶ÔÏó£¨document object£©
bgColor ºÍ fgColor
ÏûÏ¢¿ò£¨Message Box£©
±äÁ¿£¨Variables£©ºÍÌõ¼þ£¨Conditions£©
º¯Êý£¨Function£©
onClick
onLoad
onUnload
±íµ¥£¨Form£©
onBlur
Á¬½Ó£¨Link£©
ÈÕÆÚ£¨Date£©
´°¿Ú£¨window£©
ÖØÐÂÔØÈ루Reload£©
¼ÓÔØ£¨Loading£©
Ò£¿Ø´°¿Ú
¿ªÆôÆ÷£¨opener£©
¿ò¼Ü£¨Frame£©
°üº¬ÓëÒýÈ루Embedding and including£©
ÈÃÎÒÃÇÏÈ¿´Ò»¸ö¼òµ¥µÄÀý×Ó£º
<html>
<head>
<title>This is a JavaScript example</title>
<script language="JavaScript">
<!--
document.write("Hello World!");
//-->
</script>
</head>
<body> Hi, man! </body>
</html>
ͨ³£Çé¿öÏ£¬JavaScript´úÂëÊÇÒÔ<script language="JavaScript">¿ªÍ·£¬²¢ÒÔ</script>½á⣬Õû¸ö´úÂë·ÅÔÚ<head> ºÍ </head>Ö®¼ä¡£²»¹ýÓÐʱҲ¿ÉÒÔ·ÅÔÚ<body>±êÇ©ÖУ¬±ÈÈ磺
<html>
<head></head>
<body>
<script>
.....// The code embedded in the <body> tags.
</script>
</body>
</html>
ΪʲôÎÒÃÇÒª°Ñ´úÂë·Åµ½×¢ÊÍ<!—ºÍ //-->ÖÐÄØ£¿ÕâÊÇÈ·±£Ò»Ð©²»Ö§³ÖJavaScriptµÄµÍ°æ±¾ä¯ÀÀÆ÷²»ÏÔʾÕâЩ½Å±¾¡£ÕâÊÇÒ»ÖֺܺõÄ×ö·¨¡£´ËÍ⣬ָ¶¨ÓïÑÔÊôÐÔÒ²ÊÇÒ»ÖÖÑ¡Ôñ£¬Äã±ØÐëÖ¸¶¨Ìض¨µÄJavaScript°æ±¾£º
<script language="JavaScript1.2">
Äã¿ÉÒÔʹÓÃsrc ÊôÐÔÀ´°üº¬ÍⲿJavaScriptÎļþ£º
<script language="JavaScript" src="hello.js"></script>
±ÈÈç,Íⲿhello.jsÎļþ´úÂëÈçÏ£º
document.write("Hello World!")
ÍⲿÎļþÊÇÒ»¸ö°üº¬JavaScript´úÂë²¢ÒÔ ”.js” Ϊºó׺µÄÎı¾Îļþ£¬×¢Ò⣺
1. ½öÓÐ4.0ÒÔÉÏ°æ±¾ä¯ÀÀÆ÷²ÅÄÜ¿É¿¿µØ¿çƽ̨֧³ÖÕâÖÖÍⲿÒýÓýű¾µÄ·½Ê½¡£
2. ´úÂëÖв»ÄÜ°üº¬<script language...>ºÍ </script>µÈ±êÇ©£¬·ñÔ
Ïà¹ØÎĵµ£º
html:
<html>
<head>
<title>calendaragain</title>
<link rel=stylesheet href="calendaragain.css">
<script type = " ......
ÐèÇó£º
AÓòÓÐÒ³Ãæa.html£¬ÆäÖÐÓÐiframe°üº¬BÓòµÄÒ³Ãæb.html£¬ÏÖÔÚҪͨ¹ýa.htmlÉϵÄÒ»¸ö°´Å¥£¬À´°Ña.htmlÒ³ÃæÉÏÒ»¸öÎı¾¿òµÄÖµ´«µÝµ½b.htmlÒ³ÃæµÄÎı¾¿ò¡£
×¢£ºÕâÀïb.htmlÊÇhtmlÍøÒ³£¬²»ÄܽÓÊÕÆäËûÍøÕ¾post¹ýÀ´µÄÖµ£¬ËùÒÔ²»ÄÜÓÃÖ±½ÓpostµÄ·½·¨À´´«Öµ£¬µ«ÊÇ£¬Èç¹û½ÓÊÕÒ³ÃæÊÇb.aspx»òÕßb.asp ÄØ£¬ÄDz»ÊÇ¿ÉÒÔÖ±½ÓpostÁËô£¿´ð ......
// =========================================================
var XEDITOR_STATUS_NOTLOADED = 0;
var XEDITOR_STATUS_ACTIVE = 1;
var XEDITOR_STATUS_COMPLETE = 2;
var XEDITOR_TRISTATE_OFF = 0;
var XEDITOR_TRISTATE_ON = 1;
var XEDITOR_TRISTATE_DISABLED = -1;
var XEDITOR_UNKNOWN = -9;
var ......
ShowModalDialogº¯ÊýµÄ¹¦ÄÜ£º
´ò¿ªÒ»¸ö×Ó´°¿Ú£¬²¢ÇÒ¿ÉÓ븸´°¿ÚÏ໥´«µÝÊý¾Ý£¬ËüÓëwindow.openµÄ×î´óÇø±ð¾ÍÔÚÓÚÓÉShowModalDialog´ò¿ª×Ó´°¿Úºó£¬¸¸´°¿Ú½«²»ÄÜ
²Ù×÷¡£
ʹÓ÷½·¨£º
vReturnValue = window.showModalDialog(sURL [,
vArguments] [, sFeatures])
²ÎÊý˵Ã÷£º
sURL
±ØÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´ ......
JavascriptµÄEvent¶ÔÏóÓÃÀ´ÃèÊöJavascriptµÄʼþ£¬ËüÖ÷Òª×÷ÓÃÓÚIE4ºÍNN4ÒÔºóµÄ¸÷¸öä¯ÀÀÆ÷°æ±¾ÖС£
Event´ú±íʼþ״̬£¬Èçʼþ·¢ÉúµÄÔªËØ£¬¼üÅÌ״̬£¬Êó±êλÖúÍÊó±ê°´Å¥×´Ì¬¡£Ò»µ©Ê¼þ·¢Éú,±ã»áÉú³ÉEvent¶ÔÏó£¬Èçµ¥»÷Ò»¸ö°´Å¥£¬ä¯ÀÀÆ÷µÄÄÚ´æÖоͲúÉúÏàÓ¦µÄ event¶ÔÏó¡£
IE¶ÔʼþµÄÒýÓÃ
ÔÚIE4ÒÔÉÏ°æ±¾ÖУ¬event¶ÔÏó×÷Î ......