Javascript¼Ì³Ð
Ò»Ö±Ïë¶ÔJavascriptÔÙ´Î×öһЩ×ܽᣬÕýºÃ×î½ü×Ô¼ºÐ´ÁËÒ»¸öСÐÍJs
UI¿â£¬×ܽáÁËÒ»ÏÂJsµÄ¼Ì³Ð»úÖÆ£¬ÔÚÍøÉÏÒ²¿´ÁËһЩǰ±²ÃDz©¿ÍÀïµÄ×ܽᣬ¸Ð¾õ·ÖÎö²»ÊÇÌرðÈ«Ãæ¡£ÕâÀï½ö½öÊÇ°Ñ×Ô¼ºµÄѧϰÌå»áÄóöÀ´·ÖÏíһϣ¬Ï£Íû¶Ô´ó¼Ò
ѧϰJavascriptÓÐËù°ïÖú¡£
Javascript±¾ÉíÊÇ´ÓPerlÓïÑÔµÄÓï·¨Ñݱä¶øÀ´µÄ£¬±¾ÖÊÉÏÊǽű¾ÓïÑÔ£¬Ëæ×Å°æ±¾µÄ¸üÐÂÖð½¥¼ÓÈëµÄ¶ÔÃæÏò¶ÔÏóµÄÄ£Äâ¡£ÎÒÈÏΪJsµÄÃæÏò¶ÔÏóÄ£Äâ×Ü
ÌåÉÏ×öµÃ»¹ÊDz»´íµÄ£¬ÒòΪÎÒÃDz»ÄÜä´ÓÈκÎÒ»ÖÖÀíÄ²»ÄÜ´¿´âµÄΪÁËOOP¶øOOP£¬ÎÒÃÇÐèҪץסµÄÊÇÃæÏò¶ÔÏóµÄºÃ´¦µ½µ×ÊÇʲô£¿ÎªÁËÕâЩÓŵãÈ¥OOP£¬
²ÅÊÇ×îÃ÷ÖǵÄÑ¡Ôñ£¬ËùÒÔ˵Js×öµÃ»¹²»´í¡£
JsµÄ¼Ì³ÐÔںܶàÊéÀïÃæϸÖµķÖÁ˺ܶàÖÖÀàÐͺÍʵÏÖ·½Ê½£¬´óÌåÉϾÍÊÇÁ½ÖÖ£º¶ÔÏóð³ä¡¢ÔÐÍ·½Ê½¡£ÕâÁ½ÖÖ·½Ê½¸÷ÓÐÓŵãºÍȱÏÝ£¬ÕâÀïÎÒÏÈÁоٳöÀ´£¬Ôٴӵײã·Ö
ÎöÇø±ð£º
(Ò»)¶ÔÏóð³ä
JScript code
function
A(name){
this
.name
=
name;
this
.sayHello
=
function
(){alert(
this
.name
+
” say Hello
!
”);};
}
function
B(name,id){
this
.temp
=
A;
this
.temp(name);
//
Ï൱ÓÚnew A();
delete
this
.temp;
//
·ÀÖ¹ÔÚÒÔºóͨ¹ýtempÒýÓø²¸Ç³¬ÀàAµÄÊôÐԺͷ½·¨
this
.id
=
id;
this
.checkId
=
function
(ID){alert(
this
.id
==
ID)};
}
µ±¹¹Ôì¶ÔÏóBµÄʱºò£¬µ÷ÓÃtempÏ൱ÓÚÆô¶¯AµÄ¹¹Ô캯Êý£¬×¢ÒâÕâÀïµÄÉÏÏÂÎÄ»·¾³ÖеÄthis¶ÔÏóÊÇBµÄʵÀý£¬ËùÒÔÔÚÖ´ÐÐA¹¹Ô캯Êý½Å±¾Ê±£¬ËùÓÐAµÄ±äÁ¿
ºÍ·½·¨¶¼»á¸³Öµ¸øthisËùÖ¸µÄ¶ÔÏ󣬼´BµÄʵÀý£¬ÕâÑù×ӾʹﵽB¼Ì³ÐÁËAµÄÊôÐÔ·½·¨µÄÄ¿µÄ¡£Ö®ºóɾ³ýÁÙʱÒýÓÃtemp£¬ÊÇ·Àֹά»¤BÖжÔAµÄÀà¶ÔÏó£¨×¢
Òâ²»ÊÇʵÀý¶ÔÏ󣩵ÄÒýÓøü¸Ä£¬ÒòΪ¸ü¸Ätemp»áÖ±½Óµ¼ÖÂÀàA£¨×¢Òâ²»ÊÇÀàAµÄ¶ÔÏ󣩽ṹµÄ±ä»¯¡£
ÎÒÃÇ¿´µ½ÁË£¬ÔÚJs°æ±¾¸üеĹý³ÌÖУ¬ÎªÁ˸ü·½±ãµÄÖ´ÐÐÕâÖÖÉÏÏÂÎÄthisµÄÇл»ÒÔ´ïµ½¼Ì³Ð»òÕ߸ü¼Ó¹ãÒåµÄÄ¿µÄ£¬Ôö¼ÓÁËcallºÍapplyº¯Êý¡£ËüÃǵÄ
ÔÀíÊÇÒ»ÑùµÄ£¬Ö»ÊDzÎÊý²»Í¬µÄ°æ±¾°ÕÁË(Ò»¸ö¿É±äÈÎÒâ²ÎÊý£¬Ò»¸ö±ØÐë´«ÈëÊý×é×÷Ϊ²ÎÊý¼¯ºÏ)¡£ÕâÀï¾ÍÒÔcallΪÀý×Ó£¬½âÊÍÒ»ÏÂÓÃcallʵÏֵĶÔÏóð³ä
¼Ì³Ð¡£
JScript code
function
Rect(width, height){
this
.width
=
width;
this
.height
=
height;
this
.area
=
function
(){
return
this
.width
*
Ïà¹ØÎĵµ£º
ѧÓÃJS£¨javascript£©Óï¾ä´óÈ«¡£¶Ô³õѧÕߺÜÓаïÖú ¡£ÏÖÔÚÕûÀí³öÀ´£¬Ï£ÍûÄÜ°ïÖú´ó¼Ò¡£
1.document.write(""); Êä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪ//
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document->html->(head,body)
4.Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄDOM˳ÐòÊÇ:window->(navigator,screen,history,location,document)
5.µÃµ½±íµ¥ÖÐÔªËصÄÃû³ÆºÍ ......
µÚ 2 ¼¯
--------------------------------------------------------------------------------
·¶ Àý 5£º
ÔÚ Õâ Ò» ²¿ ·Ö Ê× ÏÈ Òª Ϊ Äã Õ¹ ʾ µÄ JavaScript ÌØ ÐÔ ÊÇ ½« Äã µÄ »¬ Êó ÒÆ µ½ Õâ ¸ö ²» ͬ ÑÕ É«
µÄÁ¬ ½áÉÏ Ã棬 ´Ë ʱ ¿´ ¿´ ä¯ ÀÀ Æ÷ Ï µÄ ×´ ̬ ÁÐ ÓÐ ºÎ ½á ¹û¡£ È» áá Õâ Ñù µÄ ¹¦ ÄÜ ÎÒ ÃÇ ......
µÚ Èý ¼¯
--------------------------------------------------------------------------------
Ôø ÓÐ Ðí ¶à Íø ÓÑ ÎÊ ÎÒ ÓÐ ¹ØJavaScriptÓë ¿ò ¼Ü(Ϊ Çó ·½ ±ã£¬ ÒÔ Ï ¾ù ÓÃframe±í ʾ)ºÏ Óà µÄ ÎÊ Ìâ¡£ Ê ʵ ÉÏ£¬Èô Äú ͬ ʱ Ïë ÓÃframesºÍJavaScriptµÄ ¹¦ ÄÜ£¬
Ê× ÏÈ Äú ±Ø Ðè Óµ ÓÐNetscape Navigator 2.0 (»ò ÒÔ ......
Ò»£¬javascriptµÄÄÚ²¿¶ÔÏó£¨Ï൱ÓÚϵͳµ÷Óã¬Æäʵ±¾ÖÊÊÇÒ»¸ö¹¹Ô캯Êý£©
1£¬¶¯Ì¬¶ÔÏó
ʹÓÓ¶ÔÏóʵÀýÃû.³ÉÔ±”µÄ¸ñʽÀ´·ÃÎÊÆäÊôÐԺͷ½·¨¡££¨ÓÃnewÏÈ´´½¨¶ÔÏóʵÀý£©
2£¬¾²Ì¬¶ÔÏó
Ö±½ÓʹÓÓ¶ÔÏóÃû.³ÉÔ±”µÄ¸ñʽÀ´·ÃÎÊÆäÊôÐԺͷ½·¨
¶þ£¬¼¸¸öÄÚÖö ......
flashÓëjavascriptµÄ½»»¥¿ÉÄÜÌÖÂ۵ıȽ϶à,½ñÌìΪ´ó¼Ò½éÉÜÏÂÈçºÎʹÓÃflexÓëjavascript½øÐн»»¥
Ò»¡¢ÔÚJavaScriptÖе÷ÓÃFlex·½·¨
ÔÚFlexÖпÉÒÔÓÃExternalInterfaceÀ´µ÷ÓÃFlexµÄ·½·¨£¬Í¾¾¶ÊÇ
1.ͨ¹ýÔÚFlexÓ¦Óÿɵ÷Ó÷½·¨ÁбíÖÐÌí¼ÓÖ¸¶¨µÄ¹«Ó÷½·¨¡£ÔÚFlexÓ¦ÓÃÖÐͨ¹ýµ÷ÓÃaddCallback()¿ÉÒÔ°ÑÒ»¸ö·½·¨Ìí¼Óµ½´ËÁбíÖС£addC ......