一直想做一個自己的ajax框架
最近在看javascript權威指南第四版
javascript的提供的對象比較少
//自定義的Map 對象
function Map(){
this
this
return this
}
this
this
}
this
var bln=false;
try{
for (i=
if (this
this
return true;
}
}
}catch(e){
bln=false;
}
return bln;
}
ntainsKey=function(_key){
var bln=false;
try{
for (i=
if (this
bln=true;
}
}
}catch(e){
bln=false;
}
return bln;
}
this
try{
for (i=
if (this
return this
}
}
}catch(e){
return null;
}
}
}
//測試Map的調用方法
function testMap(){
var testmap=new Map();
testmap
testmap
alert (testmap
var key=
if (ntainsKey(key)){
var element=testmap
alert (element
}else{
alert (
}
testmap
if (ntainsKey(key)){
var element=testmap
alert (element
}else{
alert (
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26414.html