how can i tell if a window is already open

javascript United States
  • 18 years ago

    i use the following code in all my pages to open a new IE window

    Code:

    mPL = window.open('../flash/player.html','mPL','directories=0,height=85,width=293,left=0,menubar=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,top=0')


    how can i tell if that window is already open so the other pages won't reload the same page

  • 18 years ago

    a number of ways.


    - set a cookie using javascript
    - you could check to see if it's open from the same page, if you (in the same function) set a variable to equal something, then you can just check if it does equal that


    if you're wanting to check it on different pages then a cookie would be the best way i reckon.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”