【发布时间】:2015-11-04 15:20:48
【问题描述】:
所以我得到一个 TypeError: invalid 'in' operand a error inside WordPress(不确定这是否与它相关),我不确定代码有什么问题。
这里是有问题的代码:
e_jsonObj = [];
$.each(the_wpcc_posts, function(i, the_wpcc_post) {
var e_post_id = the_wpcc_post[i].ID;
var e_title = the_wpcc_post[i].post_title;
var e_start = the_wpcc_post[i].post_date_gmt;
e_item = {}
e_item ["id"] = e_post_id;
e_item ["title"] = e_title;
e_item ["start"] = e_start;
console.log(e_item);
e_jsonObj.push(e_item);
});
非常感谢这里的任何帮助。
【问题讨论】:
标签: javascript jquery json wordpress each