nibbo Posted March 18, 2008 Share Posted March 18, 2008 Hi all Not sure if this is possible but here goes. I have a page that auto refreshes every 60 seconds which contains some statistics built from a database. What I want to do is get the window to automatically get focus when they change. I have a hidden element calle StatsChanged in the form that contains a value of 'True' if the stats have changed and have an onload function but I cant seem to find anything that will focus the window. The code I want is something like... function CheckStats() { if (document.getElementById('StatsChanged').value == "True") { window.focus(); } } but this dosnt appear to be working. Anyone got any bright ideas? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
haku Posted March 18, 2008 Share Posted March 18, 2008 "True" should be true. Quote Link to comment Share on other sites More sharing options...
nibbo Posted March 18, 2008 Author Share Posted March 18, 2008 Thanks for looking but the 'True' bit is the string value of the hidden element in this case so it must be in quotes. That part works OK and I have put an alert inside the condition to make sure. I just don't know what javascript I should to give the window focus. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.