Use a JSON array with objects with javascript

后端 未结 6 1707
执笔经年
执笔经年 2021-01-30 03:29

I have a function that will get a JSON array with objects. In the function I will be able to loop through the array, access a property and use that property. Like this:

6条回答
  •  梦如初夏
    2021-01-30 03:44

    var datas = [{"id":28,"Title":"Sweden"}, {"id":56,"Title":"USA"}, {"id":89,"Title":"England"}];
    document.writeln("");
    document.writeln(""); 
    for(var i=0;i");
    }
    document.writeln("
    No IdTitle
    "+datas[i].id+""+datas[i].Title+"
    ");

提交回复
热议问题