Forum Moderators: open
<script type="text/javascript">
function reload() {
setTimeout("reload()", 5 * 1000)
i += 1;
document.getElementById('sb_js').src = 'sbjs.php?x=' + i;
alert(document.getElementById('sb_js').src);
sbjs_write(); //function in sbjs.php
}
</script>
<script id="sb_js" type="text/javascript" src="" onload="reload();"></script>
sb_js's src changes but the new file seems to not have been loaded
is there any way to swap one script for another?
i'm trying to use different javascripts to replace information on the page w/o refreshing the page (something like AJAX)
I appologize if this is ugly code... I'm not much of a JS programmer.