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

javascriptʵÏּ̳еÄÁ½ÖÖ·½·¨

(Ò»)¶ÔÏóð³ä
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ʵÏֵĶÔÏóð³ä¼Ì³Ð¡£
»òÓÃcall()º¯Êý
function Rect(width, height){
    this.width = width;
    this.height = height;
    this.area = function(){return this.width*this.height;};
}
function myRect(width, height, name){
    Rect .call(this,width,height);
    this.name = name;
    this.show = function(){
    alert(this.name+” with area:”+this.area());
    }
}
ÊÇÒ»ÖÖ¶ÔÏóð³äµÄ¼Ì³Ð£¬ÆäʵÔÚcall·½·¨µ÷ÓõÄʱºò·¢ÉúµÄÊÂÇéÒ²ÊÇÉÏÏÂÎÄ»·¾³±äÁ¿thisµÄÌæ»»£¬ÔÚmyRectº¯ÊýÌåÖÐthis¿Ï¶¨ÊÇÖ¸ÏòÀàmyRect¶ÔÏóµÄʵÀýÁË£¬È»¶øÓÃÕâ¸öthis×÷ΪÉÏÏÂÎÄ»·¾³±äÁ¿µ÷ÓÃÃû×Ö½ÐRect·½·¨£¬¼´ÀàRectµÄ¹¹Ô캯Êý¡£ÓÚÊÇ´Ëʱµ÷ÓÃRectʱºò¶ÔthisµÄ¸³ÖµÊôÐԺͷ½·¨¶¼Êµ¼ÊÉÏÊǶÔÒ»¸ömyRectµÄ¶ÔÏó½øÐС£ËùÒÔ˵¾¡¹ÜcallºÍapply²¢²»Êǽö½öÎ


Ïà¹ØÎĵµ£º

JavaScript ÈçºÎµ¯³öÒ»¸ö¶Ô»°¿ò´°¿Ú

//¶¨ÒåÒª´ò¿ªµÄ¶Ô»°¿òÒ³ÃæµÄµØÖ· Ò»°ãÓÃactionÌøתҪдÃ÷actionµÄµØÖ·£¬Èç¹ûÐèÒª²ÎÊý£¬ÔòÔÚºóÃæÆ´½Ó
var urlDialog = "grpBlackWhiteManageAction.do?act=choiceMessageModel&GrpBWhiteListLevel=0";
//¶¨ÒåÒªµ¯³öµÄ¶Ô»°¿òµÄģʽ£¬dialogWidth¿í£¬dialogHeight¸ß µÈµÈ
 var style = "dialogWidth=600px;dialogH ......

javascriptÐÔÄÜÓÅ»¯

ºÜ¾Ã¾ÍÏë×ܽáһϹØÓÚjavascriptÐÔÄÜÓÅ»¯·½ÃæµÄһЩ¶«Î÷£¬Æ½Ê±Ò²ÓÐ×¢ÒâÊÕ¼¯Õâ·½ÃæµÄ×ÊÁÏ¡£°Ñdel.icio.usÀïµÄÊղصĶ«Î÷·­³öÀ´¿´Ò»±é£¬²Å¾ªÆæµØ·¢ÏÖ£¬ÕâЩËùνµÄÓÅ»¯·½·¨´ó¶à³ö×Ô¡¶javascript¸ß¼¶³ÌÐòÉè¼Æ¡·Ò»Ê飬µ±È»Ò²Óиö±ð
²»Ò»ÑùµÄ¡£×ÜÖ®Õâ±¾ÊéÉϹØÓÚjavascriptÐÔÄÜÓÅ»¯µÄÄÚÈÝ×ã×ãÓÃÁ˽ü20Ò³À´½øÐвûÊö£¬ËùÒÔ½ñÌìÎÒÒ²Õ ......

IEºÍFirefoxÔÚJavaScriptÓ¦ÓÃÖеļæÈÝÐÔ

1.document.formName.item("itemName") ÎÊÌâ
˵ Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements ["elementName"];FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔ ......

javascriptÊý¾ÝÀàÐÍת»»

parseFloat ת»»³É¸¡µãÊý
parseInt ת»»³ÉÕûÊý.
ÕâÁ½¸öº¯Êý¶¼ÓÐЩÈÝ´íÐÔµÄ,±ÈÈç"123abc"»á±ä³É123.
Èç¹ûÂ¥Ö÷Ï£Íû¸ü׼ȷһЩ,Æäʵ¿ÉÒÔÅжÏÒ»ÏÂ,È»ºóÓÃeval,ÏñÕâÑù
²»¹ýÒ²¿ÉÒÔʹÓÃÕâÑùµÄ·½·¨:
var a = "234" ;
a = a.replace(/(^[\\s]*)|([\\s]*$)/g, "");
if( a !="" && !isNaN( a ) )
{//Èç¹ûÊÇÊý×Ö
a = e ......

FusionChart µÄjavascript Ó÷¨

FusionChart  ¾Í²»ÓýéÉÜÁË°Ñ£¬Ò»¿îÖ§³Ö¶àÖÖÓïÑÔµÄͼ±íÉú³É¿Ø¼þ£¬Éú³ÉµÄͼ±í·á¸»£¬ÃÀ¹Û£¬ÇÒÓж¯Ì¬¸Ð£¬ÒòΪËüÉú´æµÄ¶«Î÷¾ÍÊÇÒ»¸öflash¡£Ò»Ï½éÉÜÒ»ÏÂËüµÄjavascript ʵÏÖ·½Ê½°Ñ¡£
·Ï»°ÉÙ˵£¬Ö±½ÓÉÏʵÀý
  <HTML>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ <HEAD>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ <SCRIPT LANGUAGE="Javascri ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ