无法调用方法';属性';未定义类jQuery的定义
HTML 我不太清楚为什么会返回错误:无法调用方法';属性';未定义类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
无法在控制台中调用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插件作者决定设置的一个奇怪属性。啊,好吧,谢谢你清理它:)