javascript - addEventListener issue to redirect in internet explorer 8 -


i have 2 pages 'a' , 'b' , default page 'a'. if there no mouse movement, automatically redirect page 'b'. this, used following code:

var inittime = null; function timeoutfunction() {         inittime = settimeout(function() {window.location = 'b';}, 5000); }  window.addeventlistener('mousemove', timeoutfunction, true); 

the above code working fine ie 10 / ie 11. not working on ie 8. make workable ie 8, there solution?

for ie 8, tried using following code:

window.attachevent("mousemove", timeoutfunction); 

but still not working :(

addeventlistener supported version 9 onward . older versions use similar attachevent function.

you can use addeventlistener ie version 9 , higher , ie8 attachevent.

please refer http://msdn.microsoft.com/en-us/library/ie/ms536343%28v=vs.85%29.aspx


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -