jQuery-can';t向函数发送值

jQuery-can';t向函数发送值,jquery,Jquery,我想在更改输入字段的默认值后向函数发送数据 function change_pos(position, new_pos) { $.post(iloc, {a:"change_pos", position:position, new_pos:new_pos}, function(d){ window.location = "[@HTTP_ADDR]/cms/gallery"; }); } <input type=\"text\" value=\"{$row[

我想在更改输入字段的默认值后向函数发送数据

function change_pos(position, new_pos) {
    $.post(iloc, {a:"change_pos", position:position, new_pos:new_pos}, function(d){
        window.location = "[@HTTP_ADDR]/cms/gallery";
    });
}

<input type=\"text\" value=\"{$row['POSITION']}\" onchange=\"change_pos('{$row['POSITION']}', this)\" />
功能更改位置(位置,新位置){
$.post(iloc,{a:“更改位置”,位置:位置,新位置:新位置,函数(d){
window.location=“[@HTTP\u ADDR]/cms/gallery”;
});
}
其想法是发送当前和“新”位置。但是函数不接受它们。
注意:PHP很好!jQuery就是问题所在

onchange
事件中的
this
替换为
this.value

onchange
事件中的
this
替换为
this.value

this
映射到
change\u pos()
参数是输入字段本身,而不是其中的值。尝试使用
this获取值。在
onchange

中,映射到
change\u pos()的
new\u pos
参数的值
是输入字段本身,而不是其中的值。尝试使用
此参数获取值。在
onchange

中,值
映射到
新位置
参数是输入字段本身,而不是其中的值。
映射到
新位置
参数的
是输入字段本身,而不是其中的值。