ÉîÈëdz³öJavaScript£¨Ò»£©
Beginning JavaScript with Dom Scripting and Ajax
ÉîÈëdz³öJavaScript
ͼÁé³ÌÐòÉè¼Æ´ÔÊé
web¿ª·¢ÏµÁÐ
×÷Õß Christian Heilmann [µÂ]
µÚÒ»Õ JavaScriptÈëÃÅ
±¾ÕÂÖ÷Òª½éÉÜ£º
* JavaSriptÊÇʲôÒÔ¼°ËüµÄ¹¦ÓÃ
* JavaSriptµÄÓÅȱµã
* ÈçºÎ°ÑJavaScriptÌí¼Óµ½Ò»¸öWebÎĵµÖУ¬JavaScriptµÄ»ù±¾Óï·¨
* ÃæÏò¶ÔÏó±à³Ì£¨OOP£©ÓëJavaScriptµÄ¹Øϵ
1. JavaScript µÄÌصã
×î´óµÄÌصã¾ÍÊÇ£¬Ò»µ©Ñ§»áÁËÈçºÎÔÚä¯ÀÀÆ÷ʹÓÃËü£¬¾Í¿ÉÒÔ°ÑËüÓ¦Óõ½ÆäËûÁìÓòÖС£Î¢ÈíµÄ·þÎñÆ÷£¨IIS£©Ê¹ÓÃJavaScriptÈ¥×ö·þÎñÆ÷¶ËÍøÒ³±à³Ì£¨ASP£©£¬PDFÎļþÏÖÔÚҲʹÓÃJavaScript£¬ÉõÖÁWindowsµÄÈÎÎñ¹ÜÀíÆ÷Ò²¿ÉÒÔʹÓÃJavaScript´úÂëÀ´×Ô¶¯ÔËÐС£Ðí¶àÓ¦ÓóÌÐò¶¼¿ÉÒÔʹÓÃËüÀ´±àд½Å±¾¡£²Ù×÷ϵͳÉϵÄÐí¶à²å¼þ£¬ÉõÖÁÔÊÐíʹÓÃJavaScript±àдСµÄ°ïÖú³ÌÐò¡£
ÁíÒ»¸ö¸üºÃµÄÌصã¾ÍÊÇ£¬JavaScript±È¸ß¼¶±à³ÌÓïÑԺͷþÎñÆ÷¶Ë±à³ÌÓïÑÔ¸üÈÝÒ׿ª·¢¡£Ëü²»ÐèÒªÏñJavaºÍC++ÄÇÑùµÄ±àÒ룬Ҳ²»ÐèÒªÏñPerl¡¢PHP»òRubyÓïÑÔÄÇÑùÔËÐÐÔÚ·þÎñÆ÷ÉÏ»òÐèÒªÔÚÃüÁîÐÐÖ´ÐС£±àд¡¢Ö´ÐС¢µ÷ÊÔºÍÓ¦ÓÃJavaScript½Å±¾ËùÐèµÄ¾ÍÊÇÎı¾±à¼Æ÷ºÍä¯ÀÀÆ÷£¬¶þÕâÁ½ÕßÔÚËùÓõIJÙ×÷ϵͳÖж¼Ìṩ¡£µ±È»£¬Ò²Óй¤¾ß¿ÉÒÔʹÄã¸ü¼Ó·½±ã£¬ÀýÈçMozilla Venkman¡¢Microsoft Script DebuggerºÍKjscmdÕâÑùµÄJavaScriptµ÷ÊÔÆ÷¡£
JavaScript ÔÚʹÓÃʱÐèÒªÓû§´úÀí£¨ÊõÓï,user agent£©£¬µ«ä¯ÀÀÆ÷²¢²»ÊÇWebÉÏΨһµÄÓû§´úÀí£¬»¹°üÀ¨:¸¨Öú¼¼Êõ¡¢´¿Îı¾´úÀí¡¢Ö§³ÖWebµÄÓ¦ÓóÌÐò¡¢ÓÎÏ·¿ØÖÆ̨¡¢ÊÖ»ú¡¢¸öÈËÊý×ÖÖúÀí£¨PDA£©¡¢½»»¥Ê½µÄµçÊÓ»ú¶¥ºÐ¡¢ËÑË÷ÒýÇæºÍÆäËûËÑË÷³ÌÐòµÈ£¬Õâô¶àÀàÓû§´úÀí£¬Ê¹ÓÃÁ˲»Í¬µÄ¼¼ÊõÊֶΣ¬¶ÔÓÚ JavaScriptÒ²ÊÇÒ»¸ö·Ç³£´óµÄΣÏÕ¡£
²¢²»ÊÇËùÓзÃÎÊÕ߶¼ÄÜÌåÑéÄãËùÓ¦ÓõÄJavaScriptÔöÇ¿£¬Ðí¶àÈ˳öÓÚ°²È«µÄ¿¼ÂǹرÕJavaScript¡£JavaScriptÊÇÒ»°ÑË«Èн£¡£Èç¹û²Ù×÷ϵͳÔÊÐí£¬¿ÉÒÔͨ¹ýJavaScriptÔÚÍøÂçÉϵÄij̨¼ÆËã»úÉÏ°²×°²¡¶¾»òÕßľÂí£¬»òÕ߶ÁÈ¡Óû§µÄÐÅÏ¢²¢°ÑËü·¢Ë͵½ÁíÒ»¸ö·þÎñÆ÷ÉÏ¡£È»¶ø£¬JavaScript»¹ÊÇÒ»¸öÓÅÐãµÄ¹¤¾ß£¬¿ÉÒÔ°ïÖúÄãÔÚƽ»¬Á÷³©µÄÍøÕ¾ÉϳåÀ˵ÄÓû§»°·ÑºÜÉÙµÄʱ¼ä¡£
2. Óŵã
ʹÓÃ
Ïà¹ØÎĵµ£º
window¶ÔÏó£ºÃ¿Ò»¸ö¸Ã¶ÔÏó´ú±íÒ»¸öä¯ÀÀÆ÷´°¿Ú
1.³£Ó÷½·¨ÈçÏÂ
open("Òª´ò¿ªµÄÒ³ÃæÎļþÃû","´ò¿ª´°¿ÚÔÚ²Ù×÷ϵͳÖеÄÃû³Æ(ÈκÎÃû³Æ¶¼¿ÉÒÔ)",
"toolbar=?,menubar=?,top=?,left=?,width=?,height=?" ......
1.ÉùÃ÷Ò»¸öDateʱ¼ä¶ÔÏóµÄ·½Ê½ÓÐÒÔÏÂÈýÖÖ
Date()£º±íʾ¹¹ÔìÒ»¸öµ±Ç°ÏµÍ³Ê±¼ä¶ÔÏó
Date(int year,int month,int day)£º¹¹ÔìµÄʱ¼ä¶ÔÏóËùÖ¸ÏòµÄʱ¼äΪ Ä꣺1900+year;Ô£ºmonth+1;ÈÕ£ºday;ʱ,·Ö,Ã룺00
Date(int millsecond)£º¹¹ÔìµÄʱ¼ä¶ÔÏó ......
<SCRIPT language=JavaScript >
function RunGLNL(){
var today=new Date();
var d=new Array("ÐÇÆÚÈÕ","ÐÇÆÚÒ»","ÐÇÆÚ¶þ","ÐÇÆÚÈý","ÐÇÆÚËÄ","ÐÇÆÚÎå","ÐÇÆÚÁù");
var DDDD=(today.getYear()<100 ? today.getYear()+1900:today.getYear())+"Äê"+(today.getMonth()+1)+"ÔÂ"+today.getDate()+"ÈÕ";
DD ......
Ò»£¬JavaScriptÖеı£Áô¹Ø¼ü×Ö
abstract extends instanceof static & ......
һ˵µ½javascript¾ÍÓÐÈË»áÏëµ½java£¬µ«ÊÇËûÃÇÍê»áÊÇÁ½»ØÊ£¬javascriptÊÇÃæÏò¶ÔÏóµÄ¶¯Ì¬ÀàÐ͵ÄÇø·Ö´óСдµÄ¿Í»§¶Ë½Å±¾ÓïÑÔ£¬Çë×¢Òâ´óСÓÐÇø±ð£¬ÃæÏò¶ÔÏó¡£javascriptÓÃ;ºÜ¶àµÄ£¬Ä¿Ç°¼¸ºõËùÓÐÖ÷Á÷ä¯ÀÀÆ÷¶¼Ö§³Ö¡£µ«ÊÇËûÓÐÒ»¸ö»µ´¦¾ÍÊDZäÁ¿£¬Èçvar
i=4;Õâ¸öi¾ÍÊÇintÀàÐ͵ģ¬var
s="hello",Õâ¸ösÊÇ×Ö·û´®ÀàÐ͵ģ ......