我有一个页面,用户填写$ _GET数据的某些选项。我想通过AJAX将这些$ _GET变量传递给.php脚本。但我的问题是,我如何传递他们迄今填写的$ _GET变量,而不刷新页面?
这是我的代码到目前为止。
$.ajax({
type: "GET",
url: "serverside script to process on data",
data:{name:youwant}, // Here is where I want to take what the user has filled out so
// far, and place it here all without refreshing the page
success: function(data){
alert("return here if success")
}
})
为什么不能在JS提取'input'元素的值? –
可能重复[获取值GET或POST变量使用JavaScript?](http://stackoverflow.com/questions/1961069/getting-value-get-or-post-variable-using-javascript) – h2ooooooo