Reputation: 117
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 ?
Upvotes: 0
Views: 111
Reputation: 533
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.
Upvotes: 1