title: Uncaught TypeError: request.open is not a function
body: <p>Code:</p>
  
  <pre><code>// urlget.html
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;AJAX GET-request example&lt;/title&gt;
  &lt;/head&gt;
  &lt;body style='text-align:center'&gt;
      &lt;h1&gt;Loading Web page into DIV&lt;/h1&gt;
      &lt;div id='info'&gt;This sentense will be replaced&lt;/div&gt;
  
      &lt;script&gt;
          nocache = "&amp;nocache=" + Math.random() * 1000000
          request = new ajaxRequest()
          request.open("GET", "urlget.php?url= amazon.com/gp/aw " + nocache, true)
  
          request.onreadystatechange = function()
          {
              if (this.readyState == 4)
              {
                  if (this.status == 200)
                  {
                      if (this.responseText != null)
                      {
                          document.getElementById('info').innerHTML = this.responseText
                      }
                      else alert('AJAX error: Data not received')
                  }
                  else alert("AJAX error: " + this.statusText)
              }
          }
          request.send(null)
  
          function ajaxRequest()
          {
              try
              {
                  request = new ActiveXObject("Msxml2.XMLHTTP")
              }
              catch(e2)
              {
                  try
                  {
                      request = new ActivateXObject("Microsoft.XMLHTTP")
                  }
                  catch(e3)
                  {
                      request = false
                  }
              }
          }
          function ret(request){return request}
          ret(request)
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I get this error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: request.open is not a function</p>
  </blockquote>