title: Javascript HTTP Request Queue within object variable - initialization doesn't work
body: <p>I got the following Request Queue implementation from this blog: </p>
  
  <p><a href="http://dsgdev.wordpress.com/2006/10/28/building-a-javascript-http-request-queue/" rel="nofollow noreferrer">http://dsgdev.wordpress.com/2006/10/28/building-a-javascript-http-request-queue/</a></p>
  
  <p>and want to wrap it with a object variable. Unfortunately the variable initialization inside doesn't work.</p>
  
  <p>Hope someone can help me with this stuff. Thanks in advance</p>
  
  <pre>
  var requestQueue = {
      inCall          : false,            // VARIABLE TO TRACK IF WE ARE CURRENTLY IN A CALL
      callToArray     : new Array(),      // QUEUE FOR CALLS
      returnToArray   : new Array(),      // QUEUE FOR FUNCTION TO EXECUTE WHEN CALL COMPLETE
      reqMethodArray  : new Array(),      // QUEUE FOR REQUEST METHOD
  
      createRequestObject : function(){
        var reqObj;
        var browser = navigator.appName;
        if(browser == "Microsoft Internet Explorer"){
          reqObj = new ActiveXObject("Microsoft.XMLHTTP");
          isIE = true;
        }else{
          reqObj = new XMLHttpRequest();
        }
        return reqObj;
      },
  
      sendCall : function(whereTo, returnTo, reqMethod){
        // GET THE NEXT ARRAY ITEM AND REMOVE FROM THE ARRAY
        this.callToArray.push(whereTo);
        this.returnToArray.push(returnTo);
  
        if (reqMethod != "GET" || reqMethod != "POST") { reqMethod = "GET"; }
        this.reqMethodArray.push(reqMethod);
      },
  
      callQueue : function(){
        // CHECK THE QUEUE AND SEND THE NEXT CALL IN LINE
        if(!this.inCall && this.callToArray.length > 0){
          // DO WE HAVE ANYTHING IN THE QUEUE?
          if(this.callToArray.length > 0){
            // WE DO, SO GET THE FIRST ITEM IN THE CALL ARRAY AND REMOVE IT
            whereTo = this.callToArray.shift();
            returnTo = this.returnToArray.shift();
            reqMethod = this.reqMethodArray.shift();
            // SEND THAT CALL
            this.doCall(whereTo, returnTo, reqMethod);
          }else{
            // UPDATE DEBUG QUEUE
          }
        }else{
          // UPDATE DEBUG QUEUE
        }
      },
  
      doCall : function(whereTo, returnTo){
        this.inCall = true;
        var http = this.createRequestObject();
        http.open('get', whereTo);
        // DO WE HAVE A FUNCTION TO CALL ONCE CALL IS COMPLETED?
        if(returnTo.length > 0){
          eval("http.onreadystatechange = " + returnTo);
        }
        // SEND CALL
        http.send(null);
      }
  };
  
  setInterval(requestQueue.callQueue, 100);
  </pre>