Sidharth
Sidharth

Reputation: 1462

JavaScript setInterval() not working on windows CE device

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.

Upvotes: 0

Views: 214

Answers (1)

Kuba Michalski
Kuba Michalski

Reputation: 70

Since both setInterval and setTimeout are methods of window object and you can't access its onload method for some reason that's where I'd search for a problem. Starting with: !!window and !!window.setInterval. Hope it can serve as some hint, I'd rather make it a comment.

Upvotes: 1

Related Questions