Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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的定义_Jquery - Fatal编程技术网

无法调用方法';属性';未定义类jQuery的定义

无法调用方法';属性';未定义类jQuery的定义,jquery,Jquery,HTML 我不太清楚为什么会返回错误:无法在控制台中调用undefined的方法'attr'。我在附加到正确类的change函数中使用this。为什么会出现此错误?请这样使用: $( ".progress-update" ).change(function() { var entry_id = this.$.attr('data-entryid'); var item_entry = this.$.attr('data-updateItem'); var new_pro

HTML

我不太清楚为什么会返回错误:
无法在控制台中调用undefined
的方法'attr'。我在附加到正确类的
change
函数中使用
this
。为什么会出现此错误?

请这样使用:

$( ".progress-update" ).change(function() {

    var entry_id = this.$.attr('data-entryid');
    var item_entry = this.$.attr('data-updateItem');
    var new_progress = $("#progress-update-" + entry_id).val();

    alert( "This is progress update" + entry_id + " and type " + item_entry + " and new progres " + new_progress );
});
attr
是一个jQuery函数,这就是为什么它只能与jQuery对象一起使用
不是jQuery对象,而是
$(此)
是。

如下使用它:

$( ".progress-update" ).change(function() {

    var entry_id = this.$.attr('data-entryid');
    var item_entry = this.$.attr('data-updateItem');
    var new_progress = $("#progress-update-" + entry_id).val();

    alert( "This is progress update" + entry_id + " and type " + item_entry + " and new progres " + new_progress );
});
attr
是一个jQuery函数,这就是为什么它只能与jQuery对象一起使用
不是jQuery对象,而是
$(此)
是。

如下使用它:

$( ".progress-update" ).change(function() {

    var entry_id = this.$.attr('data-entryid');
    var item_entry = this.$.attr('data-updateItem');
    var new_progress = $("#progress-update-" + entry_id).val();

    alert( "This is progress update" + entry_id + " and type " + item_entry + " and new progres " + new_progress );
});
attr
是一个jQuery函数,这就是为什么它只能与jQuery对象一起使用
不是jQuery对象,而是
$(此)
是。

如下使用它:

$( ".progress-update" ).change(function() {

    var entry_id = this.$.attr('data-entryid');
    var item_entry = this.$.attr('data-updateItem');
    var new_progress = $("#progress-update-" + entry_id).val();

    alert( "This is progress update" + entry_id + " and type " + item_entry + " and new progres " + new_progress );
});

attr
是一个jQuery函数,这就是为什么它只能与jQuery对象一起使用
不是jQuery对象,而是
$(此)
是。

您的代码应该如下所示

var entry_id = $(this).attr('data-entryid');

您的代码应该如下所示

var entry_id = $(this).attr('data-entryid');

您的代码应该如下所示

var entry_id = $(this).attr('data-entryid');

您的代码应该如下所示

var entry_id = $(this).attr('data-entryid');

必须使用jQuery包装元素

var entry_id = $(this).attr('data-entryid');

必须使用jQuery包装元素

var entry_id = $(this).attr('data-entryid');

必须使用jQuery包装元素

var entry_id = $(this).attr('data-entryid');

必须使用jQuery包装元素

var entry_id = $(this).attr('data-entryid');

你在哪里看到
这个。$
被使用了?看看这个问题,我也问过,还有一些
这个。&
是如何处理
$(这个)
这是jQuery旋钮插件作者决定设置的一个奇怪属性。啊,好吧,谢谢你澄清:)你在哪里看到
这个。$
被使用了?看看这个问题,我还问了一些问题,
这个和
是如何处理
$(这个)
这是jQuery旋钮插件作者决定设置的一个奇怪的属性。啊,好吧,谢谢你澄清:)你在哪里看到了
这个。$
使用了?看看这个问题,我还问了一些问题,
这个和
是如何处理
$(这个)
这是jQuery旋钮插件作者决定设置的一个奇怪的属性。啊,好吧,谢谢你澄清:)你在哪里看到了
这个。$
使用了?看看这个问题,我还问了一些关于
this.&
如何处理
$(this)
这是jQuery插件作者决定设置的一个奇怪属性。啊,好吧,谢谢你清理它:)