Saturday 5 October 2013

Make ajax call using core javascript

Make ajax call using core javascript

ref url http://stackoverflow.com/questions/3946446/why-is-my-code-failing-to-pass-parameters-from-javascript-to-jsp-using-xmlhttpre

For passind data using post use following code
var myVar1 = encodeURIComponent("c6c684d9cc99476a7e7e853d77540ceb");
xhr.open("POST", "http://csce:8080/test/index.jsp", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("id=" + myVar1);

No comments:

Post a Comment