refreshing javascript by renaming src attribute
- by Eric Fortis
I want to refresh the output of the script below. Is this json? Do I need to add a crossdomain policy in my site?
<div id="nowplaying">
<script src="http://s4.total-streaming.com/xml.php?station=1269&get=js"></script>
</div>
Edit:
This is what I'm trying based on @alexn advise, but still doesn't refresh.
<div id="nowplaying">
<script id="nowplaying-script" src="http://s4.total-streaming.com/xml.php?station=1269&get=js"></script>
<script>
setInterval(function () {
$('#nowplaying-script').attr('src', 'http://s4.total-streaming.com/xml.php?station=1269&get=js');
}, 1000);
</script>
</div>
Note Firebug: Resource interpreted as script but transferred with MIME type text/html. xml.php:-1