<script type="text/javascript">var collection = { "2548": { "album": "Slippery When Wet", "artist": "Bon Jovi", "tracks": [ "Let It Rock", "You Give Love a Bad Name" ] }}; document.write(collection);</script>保存为test.html,用浏览器打开后,显示 [object object]请问如何将整个值显示出来?请注意:用浏览器打开,不是在firebug中,点击run.
1 回答

莫回无
TA贡献1865条经验 获得超7个赞
// collection是一个对象,无法直接输出,将collection转化为字符串就行了
document.write(JSON.stringify(collection));
添加回答
举报
0/150
提交
取消