title: changing image source with refreshing ajax variable
body: <p>This function gives me <code>0</code> or <code>1</code> value in <code>#durum</code> div. Bu I want to use this value in order to show image and this image will change when the value changes. </p>
  
  <p>For example if ajax gives <code>1</code> it will show <code>1.jpg</code> or if it gives <code>0</code> it will show <code>2.jpg</code></p>
  
  <pre><code>$(document).ready(function(){
      gonder();
      var int = self.setInterval("gonder()", 500);
  });
  
  function gonder(){
      $.ajax({
          type: 'POST',
          url: 'maot.php',
          success: function (msg) {
              var data = $.parseJSON(msg);
              $("#durum").html(data[0]);
          }
      });
  }
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="durum"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The question is this ajax gives "0" or "1" to me I cannot use this value for getting image. Please help me, thanks a lot.</p>