javascriptËÙ¼ÇÊÖ²á
1.document.write("");
Ϊ
Êä³öÓï¾ä
2.JS
ÖеÄ×¢ÊÍΪ
//
3.
´«Í³µÄ
HTML
ÎĵµË³ÐòÊÇ
:document->html->(head,body)
4.
Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄ
DOM
˳ÐòÊÇ
:window->(navigator,screen,history,location,document)
5.
µÃµ½±íµ¥ÖÐÔªËصÄÃû³ÆºÍÖµ
:document.getElementById("
±íµ¥ÖÐÔªËصÄ
ID
ºÅ
").name(
»ò
value)
6.
Ò»¸öСдת´óдµÄ
JS: document.getElementById("output").value
= document.getElementById("input").value.toUpperCase();
7.JS
ÖеÄÖµÀàÐÍ
:String,Number,Boolean,Null,Object,Function
8.JS
ÖеÄ×Ö·ûÐÍת»»³ÉÊýÖµÐÍ
:parseInt(),parseFloat()
9.JS
ÖеÄÊý×Öת»»³É×Ö·ûÐÍ
:(""+
±äÁ¿
)
10.JS
ÖеÄÈ¡×Ö·û´®³¤¶ÈÊÇ
:(length)
11.JS
ÖеÄ×Ö·ûÓë×Ö·ûÏàÁ¬½ÓʹÓÃ
+
ºÅ
.
12.JS
ÖеıȽϲÙ×÷·ûÓÐ
:==
µÈÓÚ
,!=
²»µÈÓÚ
,>,>=,<.<=
13.JS
ÖÐÉùÃ÷±äÁ¿Ê¹ÓÃ
:var
À´½øÐÐÉùÃ÷
14.JS
ÖеÄÅжÏÓï¾ä½á¹¹
:if(condition){}else{}
15.JS
ÖеÄÑ»·½á¹¹
:for([initial
expression];[condition];[upadte expression]) {inside loop}
16.
Ñ»·ÖÐÖ¹µÄÃüÁîÊÇ
:break
17.JS
Öеĺ¯Êý¶¨Òå
:function
functionName([parameter],...){statement[s]}
18.
µ±ÎļþÖгöÏÖ¶à¸ö
form
±íµ¥Ê±
.
¿ÉÒÔÓÃ
document.forms[0],document.forms[1]
À´´úÌæ
.
19.
´°¿Ú
:
´ò¿ª´°¿Ú
window.open(),
¹Ø±ÕÒ»¸ö´°¿Ú
:window.close(),
´°¿Ú±¾Éí
:self
20.
״̬À¸µÄÉèÖÃ
:window.status="
×Ö·û
";
21.
µ¯³öÌáʾÐÅÏ¢
:window.alert("
×Ö·û
");
22.
µ¯³öÈ·ÈÏ¿ò
:window.confirm();
23.
µ¯³öÊäÈëÌáʾ¿ò
:window.prompt();
24.
Ö¸¶¨µ±Ç°ÏÔʾÁ´½ÓµÄλÖÃ
:window.location.href="URL"
25.
È¡³ö´°ÌåÖеÄËùÓÐ±íµ¥µÄÊýÁ¿
:document.forms.length
26.
¹Ø±ÕÎĵµµÄÊä³öÁ÷
:document.close();
27.
×Ö·û´®×·¼ÓÁ¬½Ó·û
:+=
28.
´´½¨Ò»¸öÎĵµÔªËØ
:document.createElement(),document.createTextNode()
29.
µÃµ½ÔªËصķ½·¨
:document.getElementById()
30.
ÉèÖÃ±íµ¥ÖÐËùÓÐÎı¾Ð͵ijÉÔ±µÄֵΪ¿Õ
:
var form = window.document.forms[0]
for (var i = 0; i<form.elements.length;i++){
if (form.elements[i].type ==
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
event.keycode´óÈ«(javascript)
keycode 8 = BackSpace BackSpace
keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L
keycode 19 = Pause
keycode 20 = Caps_Lock
keycode 27 = Escape Escape
keycode 32 = space space
......
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture();
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x
event.y
´°Ìå»î¶¯ÔªËØ
d ......
¡¡¡¡ÀûÓÃCookie£ºCookieÊÇä¯ÀÀÆ÷´æ´¢ÉÙÁ¿ÃüÃûÊý¾Ý.ËüÓëij¸öÌض¨µÄÍøÒ³»òÍøÕ¾¹ØÁªÔÚÒ»Æð¡£
¡¡¡¡CookieÓÃÀ´¸øä¯ÀÀÆ÷ÌṩÄÚ´æ,ÒÔ±ã½Å±¾ºÍ·þÎñÆ÷³ÌÐò¿ÉÒÔÔÚÒ»¸öÒ³ÃæÖÐʹÓÃÁíÒ»¸öÒ³ÃæµÄÊäÈëÊý¾Ý¡£
¡¡¡¡Post.htm
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
<input type="text" name="txt1">
<input type="button" value="Post">
<s ......