Jquary AJAX回调函数的问题.
我点击一个按钮进行AJAX.返回的是一个数组.然后对这个按钮的相对位置进行变化.
用的是$(this)方法.这个是错误的.this在AJAX里面貌似不是对应这个按钮.请问在回调函数里应该怎么定位这个按钮?
function bsaveclick() {
$full= $(this).parent().parent().children().eq(0).html();
$.post("change2.php", $full, function(msg) {
obj = $.parseJSON(msg);
alert(obj[1]);
$(this).parent().parent().children().eq(1).html(obj[1]);});}
[解决办法]
按纽没有id或是class吗,唯一就行,假设有个id="_TEST"
把$(this)换为$("#_TEST")
[解决办法]