By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,727 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,727 IT Pros & Developers. It's quick & easy.

this usage

P: n/a
in the following script why this is used, what is the purpose of using
self.xmlHttpReq? is it used to hold the xmlHttpReq live in the global
(window) scope?
thanks

function xmlhttpPost(strURL) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-
www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {
updatepage(self.xmlHttpReq.responseText);
}
}
self.xmlHttpReq.send(getquerystring());
}

http://www.degraeve.com/reference/si...ax-example.php

Jun 11 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
bind the XHR to the object that calls xmlhttpPost function

Jun 11 '07 #2

P: n/a
but why binding required? is XHR disposed if not bind when async.
called?

Jun 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.