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

JavaScript˽ÓгÉÔ±

//´´½¨Ò»¸öеÄÓû§¶ÔÏ󣬽ÓÊÜÒ»¸öÓÐÐí¶àÊôÐԵĶÔÏó×÷Ϊ²ÎÊý
function User(properties)
{
    for(var i in properties){(function(which){
    var p=i;
    //´´½¨´ËÊôÐÔµÄÒ»¸öеĶÁÈ¡Æ÷(getter)
    which["get"+p] = function(){
    return properties[p];
    };
    //´´½¨´ËÊôÐÔµÄÒ»¸öеÄÉèÖÃÆ÷(setter)
    which["set"+p] = function(val){
    properties[p] = val;
    };
    })(this);   
    }
}
//´´½¨Ò»¸öеÄÓû§¶ÔÐÔʵÀý£¬²¢°Ñ¾ßÓÐÁ½¸öÊôÐÔµÄÒ»¸ö¶ÔÏó´«Èë×÷ΪÖÖ×Ó
var user = new User({
    name:"Bob";
    age:44;
));
//×¢ÒânameÊôÐÔ²¢²»´æÔÚ
//ÒòΪËüÊÇÊôÐÔ¶ÔÏó(properties object)µÄ˽ÓбäÁ¿
alert(user.name == null);
//²»¹ýÎÒÃÇ¿ÉÒÔʹÓÃеÄgetname()·½·¨À´»ñµÃÕâ¸öÖµ
//ÒòΪ´Ëº¯ÊýÊǶ¯Ì¬Éú³ÉµÄ
alert(user.getname() =="Bob");
//×îºó£¬ÎÒÃÇ¿´µ½Äܹ»Ê¹ÓÃÕâ¸öÐÄÉú³ÉµÄº¯ÊýÀ´ÉèÖûò»ñµÃÄêÁä
user.setage(22);
alert(user.getage()==22);


Ïà¹ØÎĵµ£º

javascriptÔÚffºÍieÁ½ÖÖä¯ÀÀÆ÷ϵÄÇø±ð(Ò»)

1.document.formName.item('itemname')µÄÎÊÌâ ˵Ã÷£ºIEÏ¿ÉÒÔʹÓÃdocument.formName.item('itemname')ºÍdocument.formName.elements('elementsName'); FFÏÂÖ»ÄÜʹÓÃdocuement.formName.elements('elementsName'); ½â¾ö·½·¨£ºÍ³Ò»Ê¹ÓÃdocuement.formName.elements('elementsName'); 2.¼¯ºÏÀà¶ÔÏóÎÊÌâ ˵Ã÷£ºIEÏ¿ÉÒÔʹÓÃ[]ºÍ ......

javascript ѧϰ±Ê¼Ç£¨3£©

1. º¯ÊýÔÚÖ´ÐÐÍê return Ö¸Áîºó¾Í»áÍ£Ö¹Ö´ÐдúÂë.
function test(Num1,Num2){
return Num1+Num2;
alert(Num1+Num2); //never outputs

2. javascript º¯Êý²»ÄÜÖØÔØ,Ò²¾ÍÊÇ˵¿ÉÒÔÔÚͬһ¸ö×÷ÓÃÓòÖж¨Òå¶à¸öͬÃûº¯Êý,¶ø×îÖÕÖ´ÐеÄÊǺóÒ»¸öº¯Êý.
function test(num){
alert(num+10);
}
function ......

JavascriptÀàµÄд·¨

JavascriptÖÐfunction¼´ÎªÀ࣬ÔÚfunctionÄÚ²¿ÓÃthisÉèÖÃÀàµÄpublic³ÉÔ±±äÁ¿Óë·½·¨£¬ÀýÈ磺
function myclass(name){
¡¡¡¡¡¡¡¡var str = "private string";¡¡¡¡¡¡¡¡//private field
¡¡¡¡¡¡¡¡function privatefn(){¡¡¡¡¡¡¡¡¡¡¡¡//private method¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡alert(str);
¡¡¡¡¡¡¡¡};
¡¡¡¡¡¡¡¡this.name = name;
¡¡ ......

JavaScript ÄÜ×öʲô

JavaScript ÄÜ×öʲô£¿
JavaScript Ϊ HTML Éè¼ÆʦÌṩÁËÒ»ÖÖ±à³Ì¹¤¾ß HTML ´´×÷ÕßÍùÍù¶¼²»ÊdzÌÐòÔ±£¬µ«ÊÇ JavaScript È´ÊÇÒ»ÖÖÖ»ÓµÓм«Æä¼òµ¥µÄÓï·¨µÄ½Å±¾ÓïÑÔ£¡¼¸ºõÿ¸öÈ˶¼ÓÐÄÜÁ¦½«¶ÌСµÄ´úÂëƬ¶Ï·ÅÈëËûÃÇµÄ HTML Ò³Ãæµ±ÖС£ JavaScript ¿ÉÒÔ½«¶¯Ì¬µÄÎı¾·ÅÈë HTML Ò³Ãæ ÀàËÆÓÚÕâÑùµÄÒ»¶Î JavaScript ÉùÃ÷¿ÉÒÔ½«Ò»¶Î¿É± ......

.netÖÐǰ̨javascriptÓëºǫ́c#Ï໥µ÷ÓÃ


.netÖÐǰ̨javascriptÓëºǫ́c#Ï໥µ÷ÓÃ
 
¡¡¡¡C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
¡¡¡¡ÎÊ£º
¡¡¡¡1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
¡¡¡¡2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
¡¡¡¡3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
¡¡¡¡4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
¡¡¡¡ÎÊÌâ1´ð°¸ÈçÏ£º
¡¡¡¡javaScriptº¯ÊýÖÐÖ´ÐÐC# ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ