·ÁË·¡¶JavaScript»ù´¡½Ì³Ì¡·£¬ÕûÀíϳ£ÓÃ֪ʶµã
ѧºÃASP.NET£¬JavaScriptÏ൱ÖØÒª£¬Ç°Ò»¶Îʱ¼ä¿´ÍêÁË¡¶JavaScript»ù´¡½Ì³Ì¡·£¨ÁîÈËÓôÃƵÄÊÇ£¬ÔÚÎÒÂò»Ø¼ÒµÚÁù°æÖ®ºó£¬µÚÆß°æÆäʵÒѾÓÐÁË£©¡£ºÃ¾Ãû¸´Ï°ÁË£¬¼ÓÉÏƽʱѧϰºÍ¹¤×÷Éæ¼°JavaScriptµÄ²¢²»¶à£¬ËùÒÔÓÐЩ¶¼µÍüÁË¡£½ñÌìÏ°àÍæÁË»áwow£¬Äóöµãʱ¼ä¸´Ï°Ï£¬ÕûÀíÕûÀíһЩÈÝÒ×Íü¼ÇµÄ֪ʶµã¡£ÀÍÒݽáºÏ£¬¶÷¶÷……ÓÉÓÚˮƽÓÐÏÞ£¬»ù±¾É϶¼ÊÇЩ»ù´¡µÄ¶«Î÷£¬¶øÇÒͦÂҵą…²¿·Ö֪ʶµã¸ø³öÁËÀý×ÓºÍ×¢ÊÍ¡£
1¡¢document.write("") Êä³öÓï¾ä
2¡¢JSÖеÄ×¢ÊÍΪ//
3¡¢µÃµ½±íµ¥ÖÐÔªËصÄÃû³ÆºÍÖµ£ºdocument.getElementById("±íµ¥ÖÐÔªËصÄIDºÅ").name(»òvalue)
4¡¢JSÖеÄ×Ö·ûÐÍת»»³ÉÊýÖµÐÍ£ºparseInt()£¬parseFloat()
5¡¢JSÖеÄ×Ö·ûÓë×Ö·ûÏàÁ¬½ÓʹÓÃ+ºÅ
6¡¢µ±ÎļþÖгöÏÖ¶à¸öform±íµ¥Ê±£¬¿ÉÒÔÓÃdocument.forms[0]£¬document.forms[1]À´´úÌæ
7¡¢×´Ì¬À¸µÄÉèÖãºwindow.status="×Ö·û"
8¡¢µ¯³öÌáʾÐÅÏ¢£ºwindow.alert("×Ö·û")
9¡¢µ¯³öÈ·ÈÏ¿ò£ºwindow.confirm()£¬À´¸öÀý×Ó
if (confirm("Are you sure you want to do that?"))//È·¶¨·µ»Øtrue£¬È¡Ïû·µ»Øfalse
{
alert("You said yes");
}
else
{
alert("You said no");
}
10¡¢µ¯³öÊäÈëÌáʾ¿ò£ºwindow.prompt()£¬Ò²À´¸öÀý×Ó
var ans=prompt("Are you sure you want to do that?","");//²ÎÊý1ÊÇÎÊÌ⣬²ÎÊý2ÊÇĬÈϻشð
if (ans)//¹Ø±Õ£¬È¡Ïû£¬»òÕßûÓÐĬÈϻشð¶øµã»÷ÁËÈ·¶¨£¬ÒÔ¼°Çå³ýÁËĬÈϻشðµã»÷ÁËÈ·¶¨£¬¶¼·µ»Ønull
{
alert("You said"+ans);
}
else
{
alert("You refused to answer");
}
11¡¢Ö¸¶¨µ±Ç°ÏÔʾÁ´½ÓµÄλÖãºwindow.location="URL"
12¡¢È¡³ö´°ÌåÖеÄËùÓÐ±íµ¥µÄÊýÁ¿£ºdocument.forms.length
13¡¢´´½¨Ò»¸öÎĵµÔªËØ£ºdocument.createElement_x()£¬document.createTextNode()
14¡¢Ìí¼Ó½Úµã£ºa.appendChild(b)//ÏòaÖÐÌí¼Ób£¬13ºÍ14Ò»¿éÀ´¸öÀý×Ó
var inText=document.getElementById("textArea").value;
var newText=document.createTextNode(inText);//´´½¨Îı¾½Úµã
var newGraf=document.createElement_x("p");//´´½¨ÔªËؽڵã
newGraf.appendChild(newText);//½«Îı¾·Åµ½¶ÎÂäÖÐ
var docBody=document.getElementsByTagName("body")[0];
docBody.appendChild(newGraf);
14¡¢É¾³ý½Úµã£ºa.removeChild(b)//ÏòaÖÐɾ³ýb
15¡¢²åÈë½Úµã£ºa.insertBefore(b,c)//ÔÚc֮ǰ²åÈëb
16¡¢Ìæ»»½Úµã£ºa.replaceChild(b,c)
Ïà¹ØÎĵµ£º
JavaScript TableÅÅÐò
Ðò¶þ£¨09/05/03£©
½üÀ´»¹ÊÇÄÇô棬³ÃÎåÒ»¸üÐÂһϳÌÐò°É¡£
Õâ¸ö°æ±¾Ö÷ÒªÔö¼ÓºÍ¸Ä½øÁËÒÔ϶«Î÷£º
1£¬¶Ô×Ö·û´®¸ÄÓÃlocaleCompareÀ´±È½Ï£»
2£¬Ò»´ÎÅÅÐòÖÐÄÜʹÓöà¸öÅÅÐò¶ÔÏó£¨ÓÃÓÚÖµÏàµÈʱÔÙÅÅÐò£©£»
3£¬ÐÞÕýһЩ·¢ÏÖµÄÎÊÌ⣻
4£¬¸Ä½ø³ÌÐò½á¹¹£¬¸öÈ˾õµÃÊǸüÁé»î¸ü·½±ãÁË£»
5£¬Ôö¼ÓboolÀàÐÍ±È ......
ÎÄÕ³ö×Ô yiding-he.javaeye.com
JavaScript ÊÇÃæÏò¶ÔÏóµÄ¡£µ«ÊDz»ÉÙÈ˶ÔÕâÒ»µãÀí½âµÃ²¢²»È«Ãæ¡£
ÔÚ JavaScript ÖУ¬¶ÔÏó·ÖΪÁ½ÖÖ¡£Ò»ÖÖ¿ÉÒÔ³ÆΪ“ÆÕͨ¶ÔÏ󔣬¾ÍÊÇÎÒÃÇËùÆÕ±éÀí½âµÄÄÇЩ£ºÊý×Ö¡¢ÈÕÆÚ¡¢Óû§×Ô¶¨ÒåµÄ¶ÔÏó£¨È磺{}£©µÈµÈ¡£
»¹ÓÐÒ»ÖÖ£¬³ÆΪ“·½·¨¶ÔÏ󔣬¾ÍÊÇÎÒÃÇͨ³£¶¨ÒåµÄ function¡ ......
Õâ¸öµØ·½¾ÍÊÇΪʲôËüµÄStringÀàÐͲ»Ö±½ÓÌṩһ¸ötrim·½·¨ÄØ£¿
Ϊʲôÿ´Î¶¼ÒªÐ´ÕâÑùÒ»¾ä»°ÄØ£¿
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}
ÕâÑùÓÐÒâ˼Âð£¿
JavaScriptÖй涨һ¸öÕâÑùµÄ·½·¨»áËÀ°¡£¿ ......
ʵÏÖ²½Ö裺
1.×Ô¶¨ÒåÒ»¸öJavaÀ࣬¸ÃJavaÀàÖж¨ÒåÒ»¸ö·½·¨À´°üº¬ÐèÒª±»ÔËÐеĴúÂë¡£
2.¶¯Ì¬±àÒë¸Õ¸ÕÉú³ÉµÄJavaÔ´Â룬²»ÔÚ´ÅÅÌÉÏÉú³ÉÔ´Â룬¶øÊÇÖ±½Ó±àÒëÄÚ´æÖеÄJavaÔ´Âë¡£
3.¶¯Ì¬¼ÓÔظոմ´½¨±àÒëµÄJava¶þ½øÖÆÂ룬±àÒëºÃµÄJava¶þ½øÖÆÂë²»ÊÇÔÚ´ÅÅÌÉÏ£¬¶øÊÇ·ÅÔÚÄÚ´æÖУ¬²¢¶¨Òå×Ô¼ºµÄÀà¼ÓÔØÆ÷£¬¸ºÔð¼ÓÔØÄÚ´æÖеÄclassÎļþ¡£
......
ÔÌùURL: http://www.cnblogs.com/leadzen/archive/2008/02/25/1073404.html
Òý×Ó
±à³ÌÊÀ½çÀïÖ»´æÔÚÁ½ÖÖ»ù±¾ÔªËØ£¬Ò»¸öÊÇÊý¾Ý£¬Ò»¸öÊÇ´úÂë¡£±à³ÌÊÀ½ç¾ÍÊÇÔÚÊý¾ÝºÍ´úÂëǧ˿ÍòÂƵľÀ²øÖгÊÏÖ³öÎÞÏÞµÄÉú»úºÍ»îÁ¦¡£
Êý¾ÝÌìÉú¾ÍÊÇÎľ²µÄ£¬×ÜÏë±£³Ö×Ô¼º¹ÌÓеı¾É«£»¶ø´úÂëÈ´ ......