jquery doing two ajax calls under on function
<p>if have the following two scripts, when a button is clicked i wish for them both to be loaded, at the moment they are conflicting? any suggestions? the first needs to run before the second. I have tried calling two separate function but still i get a conflict  </p>

<pre><code>function showUser3(str)
{


if (str=="")
  {
  document.getElementById("basketShow").innerHTML="";
  return;
  } 
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)
    {
    document.getElementById("basketShow").innerHTML=xmlhttp.responseText;
    }
  }

        var Id = str;

        var qty = $("#"+Id).find("#qty").val();
        var productID = $("#"+Id).find("#productID").val();
        var categoryID = $("#"+Id).find("#categoryID").val();
        var priceID = $("#"+Id).find("#priceID").val();

        var url = 'ajaxAddBasket.php?productID='+productID+'&amp;categoryID='+categoryID+'&amp;qty='+qty+'&amp;priceID='+priceID+'&amp;Id='+Id;

xmlhttp.open("GET",url,true);
xmlhttp.send();


if (str=="")
  {
  document.getElementById("ajaxPallet").innerHTML="";
  return;
  } 
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)
    {
    document.getElementById("ajaxPallet").innerHTML=xmlhttp.responseText;
    }
  }


var url = 'ajaxPallet.php';
xmlhttp.open("GET",url,true);
xmlhttp.send();

}
</code></pre>
