Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery:页面中的对象及其在控制台中的可视化(chrome/firebug)_Jquery_Variables_Var_Console.log - Fatal编程技术网

JQuery:页面中的对象及其在控制台中的可视化(chrome/firebug)

JQuery:页面中的对象及其在控制台中的可视化(chrome/firebug),jquery,variables,var,console.log,Jquery,Variables,Var,Console.log,为什么有时我会在控制台中看到这样的情况: [tr.even, selector: "", context: img, jquery: "1.9.1", constructor: function, init: function…] <img src="/cell_media/img/admin/icon_deletelink.gif" onclick="deleteAliquot(this);"> 有时我会看到一些更经典的东西,比如: [tr.even, selector: ""

为什么有时我会在控制台中看到这样的情况:

[tr.even, selector: "", context: img, jquery: "1.9.1", constructor: function, init: function…]
<img src="/cell_media/img/admin/icon_deletelink.gif" onclick="deleteAliquot(this);">
有时我会看到一些更经典的东西,比如:

[tr.even, selector: "", context: img, jquery: "1.9.1", constructor: function, init: function…]
<img src="/cell_media/img/admin/icon_deletelink.gif" onclick="deleteAliquot(this);">

?

变量的控制台.log中的代码。为什么会有这种差异


在第一个示例中,变量取自一个元素,并使用父函数和子函数在DOM中导航。第二个是通过jQuery的id选择器进行经典选择。

第一个是jQuery对象,第二个只是普通DOM节点。我如何从一个传递到另一个?我有第一个,我需要第二个。。。。对不起,我的问题是noob!=)您可以使用
[0]
.get(0)
从jQuery对象获取DOM节点。主题位:使用$(“img”)。单击(函数(){deleteAliquot(this);});而不是“onclick”属性。为什么?这有什么变化?:)