Jump to content

User:Topaz/comm.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Topaz (talk | contribs) at 07:13, 7 January 2006 (debug). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
topaz.comm = {
reqlist:new Array(),
send:function(url,callback,postdata) {
  topaz.comm.reqlist.push(topaz.util.xmlhttpreq());
  var req = topaz.comm.reqlist[topaz.comm.reqlist.length-1];
  req.open("POST", url, true);
  req.onreadystatechange = function(){
    try {
      alert(req.readyState);
      if (req.readyState==4) { /*&& req.status && req.status==200*/
        callback(req);
      }
    } catch (exception) {
      alert(exception);
    }
  };
  req.send(postdata||null);
}
};