title: Make a YUI asyncRequest call which is not async
body: <p>I want to make a YAHOO.util.Connect.asyncRequest call, which not is async. Just like <a href="http://www.w3.org/TR/XMLHttpRequest/#the-open-method" rel="nofollow noreferrer">open(method, url, async)</a> where false is passed by async.</p>
  
  <p>I can't find a "syncRequest"  in the Connect class. Is this possible using YUI 2?</p>
  
  <p>I tried without YUI instead:</p>
  
  <pre><code>function createRequestObject() {
      var ro;
      // Mozilla, Safari,...
      if (window.XMLHttpRequest) {
          ro = new XMLHttpRequest();
          if (ro.overrideMimeType) {
              ro.overrideMimeType('text/xml');
              // See note below about this line
          }
          // IE
      } else if (window.ActiveXObject) {
          try {
              ro = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
              try {
                  ro = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (e) {}
          }
      }
      if (!ro) {
          alert('Giving up :( Cannot create an XMLHTTP instance');
          return false;
      }
      return ro;
  }
  function sndReq(param,server,handler) {
      http = createRequestObject();
      http.open('GET', server+"?"+param, false);
      http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
      http.onreadystatechange = handler;
      http.send(null);
  }
  </code></pre>
  
  <p>But in FireFox and Safari the callback function (handler) is not called on 'onreadystatechange' when false is passed in 'open'? In IE and Opera it works ok.</p>