Skip to content Skip to sidebar Skip to footer

How Do I POST Multiple Outputs With This Ajax Functions?

I have a function that send one output i.e. 'OPTIONS' as json using ajax. Now I need to POST multiple say two outputs. How do I modify this function so that I could POST two valiue

Solution 1:

Add another parameter to the request.send call like this:

var someOtherValue = JSON.stringify({actual : "data", goes : "here"});
request.send("options=" + encodeURIComponent(options).replace(/%20/g, '+') + "&someOtherValue=" + encodeURIComponent(someOtherValue).replace(/%20/g, '+'));

Post a Comment for "How Do I POST Multiple Outputs With This Ajax Functions?"