js:
$(function() {
var arr = { one:1, two:2, three:3, four:4};
var div_z = ""; //定义一个空变量
$.each(arr, function(key, val) {
div_z += val; //循环添加数组的value
});
$("#thecity").html(div_z); //通过div的id给div赋值!~
});
html:
html: <div id="thecity"></div>
js:
$(function() {
var arr = { one:1, two:2, three:3, four:4};
var div_z = ""; //定义一个空变量
$.each(arr, function(key, val) {
div_z += val; //循环添加数组的value
});
$("#thecity").html(div_z); //通过div的id给div赋值!~
});
html:
html: <div id="thecity"></div>