Introduction to Ajax5. Passing Parameters |
|
Join the DiscussionMore of this FeatureXMLHttpRequest Open Request Response Event Handler Send the Request Before we move on to looking at how to deal with what we get returned from our AJAX request and how to set up the server side processing to create that response, let's first look at how we can tell the server what it is that we want it to do. In the code that we have looked at so far we have defined myrequest.php as the server side process that is to handle our request. We actually have three options when it comes to setting up multiple AJAX requests for different information.
ajaxObj.open("POST", url, true);
ajaxObj.setRequestHeader("Content-Type" "application/x-www-form-urlencoded"); ajaxObj.onreadystatechange = function() { ajaxObj.processRequest();} var myform = document.forms[0]; var reqBody = getRequestBody(myform); ajaxObj.send(reqBody); |

