So I’m wanting to create a “POST” to another page. I want to do it like the following…
$.ajax({
type: "POST",
url: "maintain.aspx",
data: { key1:value1, key2:value2, key3:value3 },
success: function(msg){
alert("Done!");
}
});
The problem is I don’t have data in the form of variables. Instead I’m supplied with the data in a string formatted like so…
&myvar=1&thisguy=dave&thatguy=martin
How can I get the key/value information from that string into the data: {} section of the ajax call? Thanks!
The
dataproperty can be either an object as you have it, or a query string. So you can simply use it as-is. (though you may need to strip the leading&).