title: ajax image onload popup
body: <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
      &lt;head&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function loadXMLDoc()
  {
  
  var xmlhttp;
  
  if (window.XMLHttpRequest)
  
    {// code for IE7+, Firefox, Chrome, Opera, Safari
  
    xmlhttp=new XMLHttpRequest();
  
    }
  
  else
  
    {// code for IE6, IE5
  
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  
    }
  
  xmlhttp.onreadystatechange=function()
  
    {
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
  
      {
  
      window.alert(xmlhttp.responseText);
  
      }
  
    }
  xmlhttp.open("GET","popup.html",true);
  
  xmlhttp.send();
  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="javascript:loadXMLDoc()"&gt;
  
  &lt;div id="myDiv"&gt;&lt;h2&gt;AJAX image popup&lt;/h2&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Actually i want to use it on a joomla page, but i couldn't get any extension to do that so i created this script but the popup display html instead of the image in the page code.
  I also tried to get the image directly, but its couldn't display it.</p>
  
  <p>All i want to achieve is for an image to popup when page loads.</p>
  
  <p>Kind regards.</p>