if( !name ){
name = url;
url = locationhref;
}
var rv = '';
url = urlindexOf('') > -1 urlsplit('')[1] : '';
if(url != ''){
var ls = urlsplit('&');
for(var i=0;i<lslength;i++){
var ele = ls[i];
var kname = elesplit('=')[0] ||'',kvalue = elesplit('=')[1] || '';
if(kname === name){
rv = kvalue;
break;
}
}
}
return decodeURIComponent(rv);
}
//调用的时候就可以通过getSearch直接获得
//比如获得url中的name
function f1(){
var name = getSearch('name');
documentgetElementById("d1")value=name;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)