I have datestring ="name=one"
$.ajax({
type: "POST", url: 'url.com', data:datastring,
开发者_如何转开发 complete: function(data){
alert(data);
} ,
success:function() { alert("success"); },
})
});
I use ajax to send the datastring to url.com. However url.com redirects the page to the initial one together with some post parameters..How can I retrieve those parameters using ajax ?
You have an error in your code, because e forgot to put the semicolon ';':
$.ajax({
type: "POST",
url: 'url.com',
data:{
name: 'one'
},
complete: function(data){
alert(data);
},
success:function() {
alert("success");
},
});
Other think, it's about the data, the above example method it's better.
精彩评论