我想使用调试器检查test_data
循环中populateChildTable
(传递给$.each
的对象)中的一些属性。当我尝试使用调试器访问它们时出现undefined
错误
var populateChildTable = function(test_data) {
$.each(test_data.children, function(index, el) {
$('#my_children tbody')[0].appendChild(createChildRow(el)); // breakpoint here
})
})
Chrome版本48.0.2564.71 beta(64位)
答案 0 :(得分:1)
这与this铬虫有关。
test_data
回调范围内提供了 $.each
,您可以使用console.log(test_data)
代替debugger;
来验证这一点。开发工具优化会导致此行为,您可以在上面链接的线程中阅读该内容。