I am trying to user JavaScript function setInterval(callback, delay)
.
My code is working on all browsers(IE, Chrome, Firefox, etc) except when i run the same code to on the browser(IE) of device running WINDOWS CE , it stop at function setInterval(func, delay). Alerts work on device setinterval, but alert inside function tick is not called.
<body onload="startTimer(5000)">
//Other HTML tags or data
</body>
<script type="text/javascript">
function startTimer(sessionTime){
alert("function called startTimer");
var timerInterval = setInterval(tick, sessionTime)
}
function tick() {
alert("TICK FUCTION IS CALLED")
//Do something
}
</script>
I also tried to use setTimeout(), it is also not working either on windows ce device.
Due to some restriction i have to use onload
instead of window.onload
I need to do this interval thing in plain old JavaScript cannot use JQuery for some reason.