title: Ajax and jQuery call of $ajax url not working
body: <p>I will try to explain it a bit better.</p>
  
  <p>I have REST api I'm connecting to via the URL in the ajax. When I get that information I want to update the content within  so the content is updated according to the data got from the api call. </p>
  
  <pre><code>&lt;button onclick="myFunction()"&gt;LOAD&lt;/button&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;div class="spinner bar hide"&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
  &lt;/div&gt; 
  &lt;div class="searchtable"&gt;&lt;?php include 'hotels/hotelList.php';?&gt;&lt;/div&gt;
  
  &lt;script&gt;
      function myFunction() { 
          $('.searchtable').addClass('hide');
          $('.spinner').removeClass('hide');
  
          $.ajax({
              url: 'hotels/hotelSortBy.php?name=&lt;?php echo $name;?&gt;&amp;arrival=&lt;?php echo $arrival;?&gt;&amp;departure=&lt;?php echo $departure;?&gt;&amp;guests=&lt;?php echo $numberOfGuests;?&gt;'
          }).done(function() {
              $('.spinner').addClass('hide');
              $('.searchtable').removeClass('hide');
          });
      }
  &lt;/script&gt; 
  </code></pre>