2 replies [Last post]
Fruitcake
Offline
Enthusiast
Perth, Australia
Last seen: 13 years 43 weeks ago
Perth, Australia
Timezone: GMT+8
Joined: 2004-04-12
Posts: 257
Points: 0

Wow haven't posted here in a while.

Anyway, here's the trouble:

I'm currently using this code to open a new window:
window.open("admin_show_preview.php","preview_window","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=760, height=500").focus();

Now, whe the button that uses that code is clicked, if the window is not already open, it should open it, however if it's already opened it should refresh. Now i found that by using that code by itself in the button, it refreshes that popup window, but not from the server. The result being that it becomes worthless.

Does anyone know a way to get window.open to always get the page from the server? Or even a better way to get the result i'm looking for?

Thanks,

Dan.

I am Dan, Dan I am.

Tags:
Fruitcake
Offline
Enthusiast
Perth, Australia
Last seen: 13 years 43 weeks ago
Perth, Australia
Timezone: GMT+8
Joined: 2004-04-12
Posts: 257
Points: 0

Javascript: window.open ...

Nevermind got it fixed thanks Smile

I am Dan, Dan I am.

seb
Offline
Enthusiast
Last seen: 15 years 1 day ago
Joined: 2003-09-20
Posts: 208
Points: 0

Javascript: window.open ...

As a random addition, I find it essential to always put a window.focus(); in the onload event of the popup window. Otherwise if the window is already open but hidden from view it doesn't come to the front when a user clicks the link.