Jump to content

Javascript Pop up windows


x1nick

Recommended Posts

For my PHP framework I have a debug window which pops up when debugging is enabled

 

var dwindow = window.open('debug.php','debugwindow',',toolbar=1,resizable=1,scrollbars=yes');

 

Now at the moment this line is used every time a page is loaded (in the main window) it always opens in the same single pop up window.

 

Im wondering is there a way I can either check to see if the window is open then issue the line of code above.

OR

If I have to use window.open every time, is there a way I can only let a set of code run once the debug.php has been opened?

 

Thanks

Link to comment
Share on other sites

I'm really not following what you want. Are you wanting a new window to open for each error? If so, just change the window name to an empty string.

 

 
var dwindow = window.open('debug.php','',',toolbar=1,resizable=1,scrollbars=yes');

Link to comment
Share on other sites

Im wondering is there a way I can either check to see if the window is open then issue the line of code above.

 

I don't quite understand what you are trying to achieve.

 

If you want to open the window only if you have opened it before.

 

In theory:

1: Make an object

2: Give that object a trigger property of 0.

3: Set it to one when you open a new window.

4: Make a method that checks if trigger == 0.

Link to comment
Share on other sites

Will try explain again:

 

User opens index.php

If debug mode is enabled a single pop up window is opened (only one window is required, code in first post does this)

When user requests additional pages eg index.php?page=news (as an example)

I need some javascript that will check to see if the previous debug window that has been opened, is still open.

 

To put additional items into my debug window I use jQuery prepend function. So I need to check that the debug page has loaded before I can prepend items to my div table.

 

Guess the last one is the most important, as I need to make sure that the debug window is loaded first before trying to make changes in the window

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.