title: ajax in javascript not working. not reading the code
body: <p>I'm calling a simple JS script to load ajax functions.... and it doesn't work... I debugged using document.write to see where the problem lied and I can see my TEST 1 but not my TEST 2... </p>
  
  <p>MY HTML</p>
  
  <pre><code>&lt;html&gt;
  &lt;title&gt;Ajax Infinite scroll using jQuery - InfoTuts&lt;/title&gt;
  &lt;head&gt;
  &lt;!--&lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt;--&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" &gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;img id='loading' src='img/loading.gif'&gt;
  &lt;div class="masonry" &gt;
      &lt;div id="demoajax" cellspacing="0"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;script type="text/javascript" src="script.js"&gt;&lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>MY JavaScript</p>
  
  <pre><code> var ajax_arry=[];
   var ajax_index =0;
   var sctp = 100;
   $(function()
  {
     $('#loading').show();
  /*  document.write("TEST1");  */
  
  $.ajax(
  {
  
  /*  document.write("TEST2");  */
      url:"scroll.php",
      type:"POST",
      data:"actionfunction=showData&amp;page=1",
      cache: false,
      success: function(response)
          {
              $('#loading').hide();
              $('#demoajax').html(response); 
          }
  
     });
  
   /*  MORE CODE BELOW  */
  </code></pre>
  
  <p>my document.write  TEST 1 prints on screen, but my TEST 2 can't print.. </p>
  
  <p>It seems it's not going in the $ajax( section of the code</p>