mbarandao 0 Junior Poster


I have an ajax file to loads the content of another file into a div, here is the js code:

<script type="text/javascript">
    function showUser(str)
if (str=="")
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)

the file within xmlhttp (getcar.php) has other js codes that are to be executed once the file is loaded into the div. here is one of those files:

<!-- loading, please wait message script begins-->
<div id=\"loading\" class=\"loading-invisible\" z-index: 999>
  <p><font color=\"black\" size='4'>one moment, please!</font> <font color=#218868> Auto Tech Pro &nbsp;&laquo;&nbsp;Initiating...&nbsp;&raquo;&nbsp;</font><br /><img border='0' src='images/spinnnnnn.gif' width='215px' height='206px'>

<script type=\"text/javascript\">
  document.getElementById(\"loading\").className = \"loading-visible\";
  var hideDiv = function(){document.getElementById(\"loading\").className = \"loading-invisible\";};
  var oldLoad = window.onload;
  var newLoad = oldLoad ? function(){;;} : hideDiv;
  window.onload = newLoad;


<!-- loading, please wait message script ends-->

<script type=\"text/javascript\" src=\"\"></script>
      <script src=\"/AJAX/popBox1.2.0.js\" type=\"text/javascript\"></script>
    <link href=\"/AJAX/popBox1.2.0.css\" rel=\"stylesheet\" type=\"text/css\" />

    <script type=\"text/javascript\">

        $(document).ready(function () {
                $('#inputbox').popBox({width:550, newlineString: '<br/>' });

this however is not working. If I open getcar.php independently of the ajax, the preceeding js codes work fine, but not once the ajax loads the file into div.

Any thoughts on how this is doable?