If I have the following function:
function check(){
alert("Welcome");
}
window.onload = check();
setInterval("check();", 5000);
However, it is not working properly. Oddly enough, when I refresh the page, it works as intended. How can I resolve this issue?