Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.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 未捕获类型错误:对象[对象对象]没有方法';onclick';_Jquery_Methods_Onclick_Click - Fatal编程技术网

Jquery 未捕获类型错误:对象[对象对象]没有方法';onclick';

Jquery 未捕获类型错误:对象[对象对象]没有方法';onclick';,jquery,methods,onclick,click,Jquery,Methods,Onclick,Click,我在使用Jquery时遇到了一些问题 我在谷歌上做了一些研究,但从一周以来我没有发现任何问题,所以我决定问这个问题,也许我会有更多的机会找到问题 我在使用jqueryuncaughttypeerror时遇到了这个错误:Object[Object Object]没有方法“onclick” 事实上,我首先在文档的…中包含了jquery库,如下所示: 然后我编写了这个脚本,看到了其他一些使用jquery的脚本(这是我第一次使用它) 我不知道如何解决那个问题 任何类型的hhelp都将非常感谢。单击处理

我在使用Jquery时遇到了一些问题

我在谷歌上做了一些研究,但从一周以来我没有发现任何问题,所以我决定问这个问题,也许我会有更多的机会找到问题

我在使用jquery
uncaughttypeerror时遇到了这个错误:Object[Object Object]没有方法“onclick”

事实上,我首先在文档的
中包含了jquery库,如下所示:

然后我编写了这个脚本,看到了其他一些使用jquery的脚本(这是我第一次使用它)

我不知道如何解决那个问题


任何类型的hhelp都将非常感谢。

单击处理程序是使用not
.onclick()
注册的-jQuery API中没有这种方法

$("img.flag").click(function(){
    // Get the src of the image
    var src = $(this).attr("id");

    // Send Ajax request to backend.php, with src set as "img" in the POST data
    $.post("lib_php/session.php", {"lang": src});
})

单击处理程序是使用not
.onclick()
注册的-jQuery API中没有这种方法

$("img.flag").click(function(){
    // Get the src of the image
    var src = $(this).attr("id");

    // Send Ajax request to backend.php, with src set as "img" in the POST data
    $.post("lib_php/session.php", {"lang": src});
})
$("img.flag").click(function(){
    // Get the src of the image
    var src = $(this).attr("id");

    // Send Ajax request to backend.php, with src set as "img" in the POST data
    $.post("lib_php/session.php", {"lang": src});
})