deal with href remove the same element
var url="http://zhidao.baidu.com/question/193641504.html?name=tom&age=28"; function getName(url, name){ var firstarr = url.split("?"); var secarr = firstarr.split("&"); var thirdarr = ; for(var i=0; i<secarr.length; i++){ thirdarr* = secarr*.split("="); } for(var j=0; j<thirdarr.length; j++){ if(thirdarr==name){ return thirdarr; } } return false; } //var myvalue = getName(url,"name"); //document.write(myvalue); var duplicatedarr = ; function removeduplicateitem(arr){ for(var i=0; i<arr.length; i++){ for(var j=i+1; j<arr.length;j++){ if(arr*==arr){ //delete arr; arr.splice(j,1); } } } return arr; }