Chrome can no longer log inspectable jQuery objects from scripts [duplicate]

青春壹個敷衍的年華 提交于 2019-12-06 01:29:45
Pranav 웃

To achieve what Chrome previously used to do, append [0] to the function.

As pointed out by JanDvorak, this may not work in all cases, and provide only the first element, but works in some cases.

$(function(){
    console.log($('body')[0]);
});

Update

From here, there is a jQuery plugin jquery.chromelog made by pimvdb, which seems the way to go.

As a workaround, the inspector in Safari 6.0.2 (7536.26.17) still logs inspectable JQuery objects.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!