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?

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");
}'POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {

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.

Jun 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.