deal with href remove the same element
varurl="http://zhidao.baidu.com/question/193641504.html?name=tom&age=28";
functiongetName(url,name){
varfirstarr=url.split("?");
varsecarr=firstarr[1].split("&");
varthirdarr=[];
for(vari=0;i<secarr.length;i++){
thirdarr[i]=secarr[i].split("=");
}
for(varj=0;j<thirdarr.length;j++){
if(thirdarr[j][0]==name){
returnthirdarr[j][1];
}
}
returnfalse;
}
//varmyvalue=getName(url,"name");
//document.write(myvalue);
varduplicatedarr=[1,2,3,"a","b","e","a",7,8,3,"s","b","e","d",4,7,3];
functionremoveduplicateitem(arr){
for(vari=0;i<arr.length;i++){
for(varj=i+1;j<arr.length;j++){
if(arr[i]==arr[j]){
//deletearr[j];
arr.splice(j,1);
}
}
}
returnarr;
}
相关推荐
zhangqling 2014-05-27
Jiutocrx 2015-04-10
linkincsdn 2015-10-30
qianwenjie 2015-10-28
moxiaoxi 2016-01-08
sfkong 2016-11-26
DreamLee 2018-02-07
Dansha的花果山 2016-11-26
快乐就好 2016-04-07
wdy00 2015-10-30
hyv 2015-10-28
owhile 2015-10-12
满地星辰 2015-09-30
ghostsk 2015-04-21
jipengx 2015-04-10
zfszhangyuan 2015-02-03
pplxh 2013-12-26