云海梦尘 2011-05-11
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;
}
字符串过于长的时候需要通过仅仅展示前4个,用...表示省略,<c:if test="${fn:length<=5}">${word.type}</c:if>href触发JavaScript事件:。<a