It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Need help with window open and refreshing

Need help with window open and refreshing

Postby Beauford on Sat Mar 07, 2009 1:59 am

I have no experience at all with javascript, so I am hoping someone can help me out here.

I have a page that has links on it that when clicked opens in a new windows using window.open. What I need to have happen is that the originating browser also refreshes so it updates something on that page and also prevents the user from hitting F5 to reopen the second window again.

Any help is appreciated as this is driving me nuts, and since I have no javascript experience, I'm not even sure if this is possible or what I would have to do.

Thanks

Beauford
Beauford
 
Posts: 1
Joined: Sat Mar 07, 2009 1:48 am

Re: Need help with window open and refreshing

Postby rangana on Wed Mar 11, 2009 5:12 am

If you wish to reload the page on every second, you could use the "meta refresh tag".

For disabling the F5 key, you might find this code useful:
Code: Select all
<script type="text/javascript">
function checkKeyCode(evt) {
   var evt = (evt) ? evt : ((event) ? event : null);
   if(evt.keyCode==116) {
      evt.preventDefault();
      return false
   }
}
document.onkeydown=checkKeyCode;
</script>
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines


Who is online

Users browsing this forum: No registered users and 5 guests