<head>
<title>无标题</title>
</head>
<body>
<script type="text/javascript">
var ac = ['id1','id2']
var ad = ['title1','title2']
var ae = ['uid1','uid2']
var af = ['utitle1'消薯,'utitle2']
var r=[]
for(var i=0i<ac.lengthi++)
r.push({id:ac[i],title:ad[i],ulist:[{uid:ae[i],utitle:af[i]}]})
//输出,以进行核对
document.write("[")
for(var i=0i<r.lengthi++)
{
document.write("{")
document.write("id:'"+r[i]['id']+"',")
document.write("title:'"+r[i]['title']+"',")
document.write("ulist:[{uid:'"+r[i]['ulist'][0]['uid']+"销桥猜',")
document.write("utitle:'"+r[i]['ulist'][0]['utitle']+"'}]")
document.write("}")
if(i!=r.length-1)
document.write(",<br />")
}
document.write("]")
<亏型/script>
</body>
</html>
获取page数据,看代码:宴弯var text=this.data.name ,这样就获取到陪祥亮初始化的芦宽值page({
data:{name:"test"},
showData:function(){
var text=this.data.name
}
})
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)