URL传值<a href="b.html?a"+d></a> 10
d是一个变量。类型是一个数组,但是数组中存的是对象。值我是传到B.html中了。可是就是取不出来对象中的属性。下面是我的JS代码:a.html{varb=[];varpe...
d是一个变量。类型是一个数组,但是数组中存的是对象。值我是传到B.html中了。可是就是取不出来对象中的属性。
下面是我的JS代码:
a.html
{
var b=[];
var person1={firstname:"Bill",lastname:"gates",age:56,eyecolor:"blue"};
var person2={firstname:"Bill",lastname:"gates",age:56,eyecolor:"blue"};
var person3={firstname:"Bill",lastname:"gates",age:56,eyecolor:"blue"};
b[0]= new Object();
b[0]=person1;
alert(b);
document.getElementById('a1').href="b.html?c="+b;
}
b.html:
var seqs = window.location.search.split("=");
var seqid = seqs[seqs.length - 1];
alert(seqid);
var num;
num=seqid.split(",")
alert(num[0]);
alert(num.length);
mum.[0].age就是空。。。
a.html页面:
<a id="a1" href="" onclick="get()">ads</a>;
get()就是A.HMTL的js 展开
下面是我的JS代码:
a.html
{
var b=[];
var person1={firstname:"Bill",lastname:"gates",age:56,eyecolor:"blue"};
var person2={firstname:"Bill",lastname:"gates",age:56,eyecolor:"blue"};
var person3={firstname:"Bill",lastname:"gates",age:56,eyecolor:"blue"};
b[0]= new Object();
b[0]=person1;
alert(b);
document.getElementById('a1').href="b.html?c="+b;
}
b.html:
var seqs = window.location.search.split("=");
var seqid = seqs[seqs.length - 1];
alert(seqid);
var num;
num=seqid.split(",")
alert(num[0]);
alert(num.length);
mum.[0].age就是空。。。
a.html页面:
<a id="a1" href="" onclick="get()">ads</a>;
get()就是A.HMTL的js 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询