我使用的是AJAX函数,结果是 $('.class').each 执行一些逻辑。
$('.class').each
问题是 $(this) 要检索到每个对象,请引用AJAX函数,而不是找到的元素。
$(this)
如何引用 each 功能?
each
$.ajax({url: "myurl", success: function(result){ $(".my_class").each((index, dom) => { console.log(($(this))); //this is the ajax funct, not the object i want }); });