I have a script tag with an src, how can I reload the src with java script code, this is the code I have:
<script src='./script.php'>
<script>
function reload() {
//the code to reload the src
}
</script>
I have a script tag with an src, how can I reload the src with java script code, this is the code I have:
<script src='./script.php'>
<script>
function reload() {
//the code to reload the src
}
</script>
Snippet:
<script>
function reload() {
var head= document.getElementsByTagName('head')[0];
var script= document.createElement('script');
script.src= './script.php';
head.appendChild(script);
}
reload();
</script>