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

javascript common

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.type == "text "){
form.elements.value = " ";
}
}
31.¸´Ñ¡°´Å¥ÔÚJSÖÐÅж¨ÊÇ·ñÑ¡ÖÐ:document.forms[0].checkThis.checked (checkedÊôÐÔ´ú±íΪÊÇ·ñÑ¡Öзµ»ØTRUE»òFALSE)
32.µ¥Ñ¡°´Å¥×é(µ¥Ñ¡°´Å¥µÄÃû³Æ±ØÐëÏàͬ):È¡µ¥Ñ¡°´Å¥×éµÄ³¤¶Èdocument.forms[0].


Ïà¹ØÎĵµ£º

JavaScriptµÄnamespace(Ò»)

ÒýÈëÃüÃû¿Õ¼ä֮ǰ£¬Ò»¸öÁ·¢ÈËԱͷÌÛµÄÎÊÌâ¾ÍÊÇÈçºÎ·ÀÖ¹º¯ÊýÃû/ÀàÃûºÍÆäËûÈ˵ijåÍ»£¬ÔÚÒ»¸ö¹«Ë¾ÄÚ²¿ÏîÄ¿×éÖ®¼ä¿ÉÒÔͨ¹ýÃüÃûÔ¤¶¨£¨±ÈÈç¼Óǰ׺
µÈ£©½â¾öÕâ¸öÎÊÌ⣬µ«ÊÇ°ÑÊÓÏ߷ŵ½Õû¸öÈí¼þ¿ª·¢ÁìÓò£¬ÔÚµ±½ñЭ×÷¿ª·¢Ï൱ʢÐеÄʱ´ú£¬Õâ¸öÎÊÌâÈ´ÒÀÈ»´æÔÚ¡£ÔÚʹÓöà¸öµÚÈý·½¿ò¼Ü»òÀà¿âµÄʱºò£¬ÄãΨһÄÜ×÷
µÄ¾ÍÊÇÆíµ»ËüÃǵÄÃüà ......

Javascript ÖÐ String.replace( ) µÄÃîÓÃ

<script language="javascript">
<!--
String.prototype.replaceAll = stringReplaceAll;
function stringReplaceAll(AFindText,ARepText){
raRegExp = new RegExp(AFindText,"g");
return this.replace(raRegExp,ARepText)
}
var content = "%sfasf%sfd%asdfsadf%1111%"
 // °Ñ ËùÓÐµÄ % Ì滻Ϊ #
......

javascriptºËÐÄѧϰ±Ê¼Ç

±äÁ¿
1.       Èç¹ûûÓÐÓÃvarÓï¾ä¸øÒ»¸ö±äÁ¿¶¨³õʼֵ£¬ËüµÄ³õʼֵ¾ÍÊÇundefined.
2.       ³¢ÊÔ¸øδÓÃvarÉùÃ÷µÄ±äÁ¿¸³Öµ£¬JavaScript»áÒþʽÉùÃ÷¸Ã±äÁ¿¡£µ«ÊÇ£¬ÒþʽÉùÃ÷µÄ±äÁ¿×ÜÊDZ»´´½¨ÎªÈ«¾Ö±äÁ¿£¬¼´Ê¹¸Ã±äÁ¿Ö»ÔÚÒ»¸öº¯ÊýÌåÄÚʹÓá£
3.    ......

ECMA ÍƳö JavaScript 5

ECMA ±¾ÖÜÍƳöÁË JavaScript 5£¨PDF£©£¬³ýÁËÔöÇ¿»ù´¡º¯Êý¿âÖ®Í⣬»¹ÒýÈëÁËÑϸñÔËÐÐʱģʽ£¨Strict Runtime Modes£©ÒÔ±ÜÃâ´úÂëÖеij£¼û´íÎó¡£ECMA ECMAScript 4 µÄŬÁ¦ÔøÒÔʧ°Ü¸æÖÕ£¬ECMA ÉõÖÁûÓз¢²¼ ECMAScript 4 ϸÔò¡£
¹ýÈ¥¼¸Ä꣬ÖîÈç Nitro£¬TraceMonkey Ò»ÀàµÄ JavaScript ÒýÇ淢չѸÃÍ£¬JavaScript ³ÉÁË Google Wa ......

javascriptÖеÄ×Ö·û´®±àÂëת»»

ÆðÒò£º
×Ô¶¨ÒåµÄÒ»¸öspiderÔÚץȡÀ´µÄÊý¾ÝÖУ¬Óи÷ʽ¸÷ÑùµÄÊý¾Ý´æ´¢±àÂ룬ÓÐЩ±àÂëÊÇ \uxxxx\uxxxx µÄ·½Ê½,Õâ¾ÍÉæ¼°µ½Ò»¸öunicodeµ½¿É¼û×Ö·ûµÄת»»£¬±ÈÈçת»»Îªgb2312£¬ÕâÑù²ÅÄÜ·½±ãÎÒÃÇÀ뿪ä¯ÀÀÆ÷ºóÒ²ÄÜÔĶÁ¡£
ÔÚÍøÉÏÕÒÁ˺ܶà´Î·½ÃæµÄ±àÂëת»»¶ÔÕÕ±í£¬²»¹ý¼¸ºõûÓÐÒ»¸öÍêÕû£¬ËùÒÔ×Ô¼ºÕûÀíÁËÒ»·Ý£¬Ï£Íû¶Ô´ó¼ÒÓаïÖú¡£Ëü°ü ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ