i've wrote a script in which javascript file and innerHTML refreshes time to time
setInterval(activeload,1000);
function activeload() {
activediv.innerHTML="";
scriptsrc.src="http://localhost/mypro/pro/activeuser.php";
for(i=0;i<=activeuser.length;i++) {
if(activeuser[i]!=null)
activediv.innerHTML+="<p onclick='dial(' " + activeuser[i] +" ' )'> " + activeuser[i] +"</p><br>";
}
scriptsrc.src='';
}
in the above script, innerHTML is modifying, but src attribute of script is not changing...
the js file loaded is
<script src="http://localhost/mypro/pro/activeuser.php" id="scriptsrc" type="application/javascript"></script>
this php file refreshes every 5 secs and is accurate in information.
need some help in loading the javascript perfectly
scriptsrc? More importantly, what are you trying to do here?var scriptsrc=document.querySelector('#id_of_script_tag');setIntervalfor frequent updating of informationsrcisphpwhich gives updated array at every interval of time. Im not actually changing script src, but reloading the same script again, please help