Javascript¼òÒ×½Ì³Ì 1
¹ØÓÚThis
1. ËüÊÇÒ»¸ö¹Ø¼ü×Ö£¬²¢²»ÊDZäÁ¿Ãû»òÊôÐÔÃû¡£
2. Ëüʵ¼ÊÖ¸functionËù¹ØÁªµÄ¶ÔÏó£¬Èç¹ûfunctionûÓйØÁªÈκζÔÏó£¬ÔòthisÊÇGlobal¶ÔÏó
var msg = 'I am global';
function showMsg(){
alert(this.msg);
};
function nestedShowMsg (){
var nested = function(){
alert(this.msg);
};
nested();
};
var owner = {msg:'I am local'};
owner.showMsg = showMsg;
owner.nestedShowMsg = nestedShowMsg;
showMsg(); //should be 'I am global'
owner.showMsg(); //should be 'I am local'
owner.nestedShowMsg();should be 'I am global'
Ïà¹ØÎĵµ£º
JavascriptÎļþ¼°Îļþ¼Ð²Ù×÷
Ò»¡¢¹¦ÄÜʵÏÖºËÐÄ£ºFileSystemObject ¶ÔÏó
ÒªÔÚjavascriptÖÐʵÏÖÎļþ²Ù×÷¹¦ÄÜ£¬Ö÷Òª¾ÍÊÇÒÀ¿¿FileSystemobject¶ÔÏó¡£
¶þ¡¢FileSystemObject±à³Ì
ʹÓÃFileSystemObject ¶ÔÏó½øÐбà³ÌºÜ¼òµ¥£¬Ò»°ãÒª¾¹ýÈçϵIJ½Ö裺 ´´½¨FileSystemObject¶ÔÏó¡¢Ó¦ÓÃÏà¹Ø·½·¨¡¢· ......
1. Javascript Debug Toolkit½éÉÜ
JSDT(Javascript Debug Toolkit)ÊÇÒ»¸öÓÃÓÚjavascriptµ÷ÊÔµÄeclipse
²å¼þ£¬ÓÃÓÚµ÷ÊÔjavascript¡£JSDT¿ÉÒÔ¿çä¯ÀÀÆ÷µ÷ÊÔ£¬Ö§³ÖÔÚIE,Firefox,Safari,ChromeµÈÖ÷Á÷ä¯ÀÀÆ÷Öе÷ÊÔ
javascript¡£JSDTÖ§³ÖÉèÖöϵ㣬µ¥²½µ÷ÊԵȵ÷ÊÔ¹¤¾ßµÄ»ù±¾ÌØÐÔ¡£
2. ÈçºÎ°²×°
JSDTÊÇ»ùÓÚeclipse3.2+,jdk1.5+ ......
±¾ÎļòÒª½éÉÜJavaScriptÖÐconfirm,alert,promptµÄÓ÷¨,Ï£Íû´ó¼Òѧϰ¹ý³ÌÖÐÄܵõ½Ò»Ð©Æô·¢¡£
window.confirm ²ÎÊý¾ÍÖ»ÓÐÒ»¸ö¡£ÏÔʾÌáʾ¿òµÄÐÅÏ¢¡£°´È·¶¨,·µ»Øtrue£»°´È¡Ïû·µ»Øfalse¡£
< SCRIPT> var bln = window.confirm("È·¶¨Âð?"); alert(bln) < /SCRIPT> window.alert²ÎÊý£¬Ö»ÓÐ ......
JavaScriptµÄä¯ÀÀÆ÷¶ÔÏóÏê½â
Ò»¡¢ä¯ÀÀÆ÷¶ÔÏó²ã´Î¼°ÆäÖ÷Òª×÷ÓÃ
¶þ¡¢Îĵµ¶ÔÏó¹¦Äܼ°Æä×÷ÓÃ
Èý¡¢·¶Àý
ʹÓÃä¯ÀÀÆ÷µÄÄÚ²¿¶ÔÏóϵͳ, ¿ÉʵÏÖÓëHTMLÎĵµ½øÐн»»¥¡£ËüµÄ×÷ÓÃÊǽ«Ïà¹ØÔªËØ×éÖ¯°ü×°ÆðÀ´£¬Ìṩ¸ø³ÌÐòÉè¼ÆÈËԱʹÓ㬴Ӷø¼õÇá±à³ÌÈ˵ÄÀͶ¯£¬Ìá¸ßÉè¼ÆWebÒ³ÃæµÄÄÜÁ¦¡£
Ò»¡¢ä¯ÀÀÆ÷¶ÔÏó²ã´Î¼°ÆäÖ ......
<mce:script type="text/javascript"><!--
document.write("<table border=1px border-color=red>"); //±í¸ñ¿ªÊ¼
for (h = 1; h <= 10; h++) {
document.write("<tr>"); //¿ªÊ¼µÚÒ»ÐÐ
for (s = 1; s <= 10; s++) {
var num = (h-1)*10+s; ......