title: Jquery - How do I make ifModified:true work in .ajax request?
body: <p>I have a simple script where an Ajax request is made every 2 seconds. If the data fetched from a php page called "ext" is different from the last data acquired, the code runs a function: in order to do this I use the ifModified:true setting on the ajax request, but it doesn't work.</p>
  
  <p>This is the code I am using</p>
  
  <pre><code>$(document).ready(function(){
  
  setInterval(repeat,2000);
  
  function repeat(){
  $.ajax({
    type: "GET",
    url: "ext.php",
    ifModified: true,
    success:function(data) {
  $('.photo').fadeOut(5000).delay(1000).css('background-image', 'url(' + data + ')' ).fadeIn(5000);
  }
  });
  }
  
  });
  </code></pre>
  
  <p>and this is the code found in the "ext.php": its aim is to simply output the path to the last added jpg into a directory.</p>
  
  <pre><code>&lt;?php
  $array = glob("images/{*.jpg,*.JPG}", GLOB_BRACE);
  $ultimo = end($array);
  ?&gt;
  &lt;?php echo $ultimo; ?&gt;
  </code></pre>
  
  <p>At the present time the script sets an image, whose path is found in ext.php, as the background of the div with class ".photo" with a fadeOut and a fadeIn. My idea is that when the path is the same as the previous used, the image shouldn't repeat the fadeOut and fadeIn but just stay still until a new path is provided.</p>
  
  <p>What am I missing?</p>