javaScript 动态访问JSon元素示例代码
内容摘要
复制代码 代码如下: $(document).ready(function () {
var obj = {Name: 'Allen', Age: '30'}; for (var o in obj) { var a = console.log(o); // Name ,Age var a = con
var obj = {Name: 'Allen', Age: '30'}; for (var o in obj) { var a = console.log(o); // Name ,Age var a = con
文章正文
复制代码 代码如下:
$(document).ready(function () {
var obj = {Name: 'Allen', Age: '30'};
for (var o in obj)
{
var a = console.log(o); // Name ,Age
var a = console.log(obj[o]); //Allen,30
}
});
</script>
代码注释