展开全部
location是浏览器内置对象,不e5a48de588b662616964757a686964616f31333337386634能自己定义名为location的变量。
变量名中不能包含"-"符号
数组下标从0开始
获取URLMylocation = {};
Mylocation.search = '?username=789&mobienumber=789';
alert(Mylocation.search);
function relocationa()
{
alert(Mylocation.search);
}
function geturlinf()
{
var str=Mylocation.search;
var words=str.split('&');
var words1Len=words[0].length;
var words2Len=words[1].length;
alert(words[0].substring(10,words1Len));
alert(words[1].substring(12,words2Len));
}