title: Ajax request doesn't work for mobile devices
body: <p>I am so new for ajax and jquery!</p>
  
  <p>At the below, my codes are working as a charm at desktop pc's. </p>
  
  <p>I can collect the spent  time for clients, but in mobile devices ajax request is not working. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var startTime = new Date();        //Start the clock!
  window.onbeforeunload = function()        //When the user leaves the page(closes the window/tab, clicks a link)...
  {
      var endTime = new Date();        //Get the current time.
      var timeSpent = (endTime - startTime);        //Find out how long it's been.
      var xmlhttp;        //Make a variable for a new ajax request.
      if (window.XMLHttpRequest)        //If it's a decent browser...
      {
          // code for IE7+, Firefox, Chrome, Opera, Safari
          xmlhttp = new XMLHttpRequest();        //Open a new ajax request.
      }
      else        //If it's a bad browser...
      {
          // code for IE6, IE5
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");        //Open a different type of ajax call.
      }
      var url = "http://www.example.com/time.php?time="+timeSpent;        //Send the time on the page to a php script of your choosing.
      xmlhttp.open("GET",url,false);        //The false at the end tells ajax to use a synchronous call which wont be severed by the user leaving.
      xmlhttp.send(null);        //Send the request and don't wait for a response.
  }
  &lt;/script&gt; 
  </code></pre>
  
  <p>It doesnt work for my phone (iphone)!</p>
  
  <p>Anyone could help me out please?</p>
  
  <p>Thanks!</p>