views:

47

answers:

2

It's works fine for only 5 min in chrome then the page doesn't respond am i miss anything . This is my code.It works fine in FF and IE8 Browsers

function do(){
            // coding     
            setTimeout(do,30000);
            if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1){
      setInterval(do,20000);
   }
        }

Thankyou in advance

+4  A: 

do is a reserved word I believe, in Chrome ( do.. while ):

function do(){}
SyntaxError: Unexpected token do

Try naming it differently?

Wait: Why are you browser sniffing?

meder
++ a better question is why the double compounded recursion. exponential recursion even?
Sky Sanders
Thanks for Your reply . I found that setInterval method will take 100% cpu usage in chrome browser only . see the link belowhttp://code.google.com/p/chromium/issues/detail?id=25892
Kart3
A: 

Thanks for Your reply . I found that setInterval method will take 100% cpu usage in chrome browser only . see the link below code.google.com/p/chromium/issues/detail?id=25892

Kart3

related questions