Everything is running smoothly with this code snippet...an alert pops up every 10 seconds
<script type='text/javascript'>
function letsTest(){
alert("it works");
}
var uptimeId = window.setInterval(letsTest, 10000);
</script>
However, the moment I move my letsTest
function to a file named javaScript.js, it stops functioning.
Main page:
<script src='lib/javaScript.js' type='text/javascript'>
var uptimeId = window.setInterval(letsTest, 10000);
</script>
javaScript.js
function letsTest(){
alert("it works");
}
I have double-checked the path and spelling numerous times. I also use my javaScript.js
in other places without any issue. Is it possible to set an interval with a function from another file?