Error when using $.ajax() and Create an XMLHttpRequest object in the same page

Error when using $.ajax() and Create an XMLHttpRequest object in the same page

Hi all,
I fetch information from database using ajax , one time using $.ajax() and the other by create  XMLHttpRequest object in the same  page ,
my code looks like this :

HTML code :

  1. <button class='orderBtn' >order</button>
  2. <!--here some html code-- >
  3. <ul id='item-nav'>
  4.   <li ><a cate_id='1'>item_1 </a></li>
  5. <li ><a cate_id='2'>item_2 </a></li>
  6. </ul>
  7. <div id="items_container"></div>

_javascript code :

  1. $(document).ready(function() {

  2. //here some code

  3. $("ul#item-nav li").click(function() {
  4.             
  5.             //here some code
  6.             setTimeout(function() {
  7.                 showItems(code,id);
  8. }, 300);
  9.             
  10.         });

  11. //here i included the order_fn.js file where i used $.ajax()
  12. $.getScript("js/order_fn.js"); 

  13. })

  14. //get data using ajax__2
  15. function showItems(str,id) {
  16. document.getElementById("items_container").innerHTML = "";
  17.     if (str == "") {
  18.         document.getElementById("items_container").innerHTML = "";
  19.         return;
  20.     } else { 
  21.         if (window.XMLHttpRequest) {
  22.             // code for IE7+, Firefox, Chrome, Opera, Safari
  23.             xmlhttp = new XMLHttpRequest();
  24.         } else {
  25.             // code for IE6, IE5
  26.             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  27.         }
  28.         
  29.         xmlhttp.onreadystatechange = function() {
  30.             if (xmlhttp.readyState == 4 && xmlhttp.status == 200 ) {

  31.                 //by reloading order_fn.js my code works well
  32.              $.getScript("js/order_fn.js");
  33.                 
  34.                 document.getElementById("items_container").innerHTML = xmlhttp.responseText;
  35.                 
  36.             }
  37.         }
  38.         
  39.         xmlhttp.open("GET","getcateg.php?cate_code="+str+"&cateID="+id,true,function() {
  40.                 
  41. });
  42.         xmlhttp.send();
  43.        

  44.     }
  45.  }
    
  order_fn.js file :
 
  1. //get data using ajax__1
  2. $('.orderBtn').click(function (){
  3. //some code
  4. $.ajax({
  5.            url: 'file_name.php',
  6.            data:formData,
  7.            dataType: "json",
  8.            type: 'GET',
  9.            success: function(data) {
  10.             //do something here
  11.            }
  12.         });
  13. });

my code was work well before I expand it with  using XMLHttpRequest.
When i used XMLHttpRequest the click event on .orderBtn button does not work after execute the ajax event using XMLHttpRequest.

so I Dismissed it in a separate file "order_fn.js" file ,because it need to use the instruction 
  1. $.getScript("js/order_fn.js");
two time ,one to include the code and the other to reload it after execute the ajax event using XMLHttpRequest.

my question is ,Is this the best way to resolve that problem?
I need your guidance in how to improve my code.
thanks.