/ Published in: JavaScript
Class to make remote requests, which can be used on the popular "AJAX".
Expand |
Embed | Plain Text
/* Wrapper function for constructing a Request object. Parameters: reqType: The HTTP request type such as GET or POST. url: The URL of the server program. asynch: Whether to send the request asynchronously or not. */ function httpRequest(reqType,url,asynch){ //Mozilla-based browsers if(window.XMLHttpRequest){ request = new XMLHttpRequest(); } else if (window.ActiveXObject){ request=new ActiveXObject("Msxml2.XMLHTTP"); if (! request){ request=new ActiveXObject("Microsoft.XMLHTTP"); } } //the request could still be null if neither ActiveXObject //initializations succeeded if(request){ initReq(reqType,url,asynch); } else { alert("Your browser does not permit the use of all "+ "of this application's features!");} }
Comments
Subscribe to comments
You need to login to post a comment.

Hi test