looking for some solutions? You are welcome.

SOLVED: Auto refresh specific div and load image with jquery/ajax

Mark:

I have an internet radio station and I need a script that will display a picture of the current song in a particular dvi with an id. The image is automatically uploaded via ftp to the server each time the song changes..

HTML:

<div id="auto"></div>

JS:

  $ (document).ready(function() {
    $('#auto').html('<img src="artwork.png"></img>');
    refresh();
  });

  function refresh() {
    setTimeout (function() {
      $('#auto').html('<img src="artwork.png"></img>');
      refresh();
    }, 1000);
  }

I tried this, but all I get is that the image is loaded, but in case of a change, I have to manually refresh the whole page again..



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent