| | |
new window popup
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
the only way you could do that would be if your first window is opened by javascript (or maybe by named target).
otherwise, it would be an irritation risk if sites could close the browser.
if you want the parent window to close when a new page opens, why not just open the new page in the same window?? O_o
otherwise, it would be an irritation risk if sites could close the browser.
if you want the parent window to close when a new page opens, why not just open the new page in the same window?? O_o
Plato forgot the nullahedron..
...perhaps that's not true.
in Opera:
works whether the window that processes that code was opened via a javascript process or not..
...interesting info.
in Opera:
HTML and CSS Syntax (Toggle Plain Text)
<html> <head></head> <body> <script type="text/javascript"> window.close(); var newWindow = window.open('/home/matt/test3.html'); </script> </body> </html>
works whether the window that processes that code was opened via a javascript process or not..
...interesting info.
Last edited by MattEvans; Jan 12th, 2007 at 3:00 pm.
Plato forgot the nullahedron..
by the way. you will probably get an alert or 2 if that kind of thing is done on a browser that's alert-ridden, like IE7.
FOLLOWUP:
Even on an oldish version of Firefox (1.0.2), the correct behaviour is adhered to; the correct behaviour being that only script-generated windows can close themselves or be closed. Proofing is as follows:
File #1 (test1.html)
File #2 (test2.html)
File #3 (test3.html)
Opening the browser on test1.html causes test2.html to be opened in a new window, then that window is closed and test3.html is loaded in another new window.
Opening the browser on test2.html causes test3.html to be opened in another window: but the window holding test2.html doesn't close.
There was also a 'popup blocked' bar until I allowed popups from my local machine. That would be present in most browsers. Except the ultimate Opera of course..
FOLLOWUP:
Even on an oldish version of Firefox (1.0.2), the correct behaviour is adhered to; the correct behaviour being that only script-generated windows can close themselves or be closed. Proofing is as follows:
File #1 (test1.html)
HTML and CSS Syntax (Toggle Plain Text)
<html> <head></head> <body> <script type="text/javascript"> alert("Opening test2 in a new window"); var newWindow = window.open('/home/matt/test2.html'); </script> </body> </html>
File #2 (test2.html)
HTML and CSS Syntax (Toggle Plain Text)
<html> <head></head> <body> <script type="text/javascript"> alert("Closing test2's window"); window.close(); var newWindow = window.open('/home/matt/test3.html'); </script> </body> </html>
File #3 (test3.html)
HTML and CSS Syntax (Toggle Plain Text)
(doesn't matter)
Opening the browser on test1.html causes test2.html to be opened in a new window, then that window is closed and test3.html is loaded in another new window.
Opening the browser on test2.html causes test3.html to be opened in another window: but the window holding test2.html doesn't close.
There was also a 'popup blocked' bar until I allowed popups from my local machine. That would be present in most browsers. Except the ultimate Opera of course..
Last edited by MattEvans; Jan 12th, 2007 at 3:12 pm.
Plato forgot the nullahedron..
well, if you're automatically opening windows you're always going to hit an alert on newer browsers, and you can only be sure you'll be able to close a window that you "own".
information doesn't have to be shared between the two pages. if you're worried about people pressing the 'back' button; that's a system beyond your control.
if you're using sessions (cookies/QSA) of some description, you can expire or invalidate the login; the users wont have authorititave access to your site after logging out; but they'll always be able to recall their cache.
The only way around that is 'scrambling' delivered pages and using JavaScript to 'unscramble' page content based on a cookie everytime a page loads. But even that won't stop browsers like Opera from recalling pages (it retains DOM/JS state between pages)
information doesn't have to be shared between the two pages. if you're worried about people pressing the 'back' button; that's a system beyond your control.
if you're using sessions (cookies/QSA) of some description, you can expire or invalidate the login; the users wont have authorititave access to your site after logging out; but they'll always be able to recall their cache.
The only way around that is 'scrambling' delivered pages and using JavaScript to 'unscramble' page content based on a cookie everytime a page loads. But even that won't stop browsers like Opera from recalling pages (it retains DOM/JS state between pages)
Plato forgot the nullahedron..
•
•
Join Date: Jan 2007
Posts: 6
Reputation:
Solved Threads: 0
ya ...but i would like to discuss the problem once again,and hope that some1 can give me a help..
i have a jsp page main ,containg two frames in which 2 different jsp r loaded.....one of them has a logout link....wht i want is to click on the logout link closes the main jsp page that contains both of them and opening another jsp for the logout...in a totally new window.....might b the problem is now more clear and have a quick solution..
i have a jsp page main ,containg two frames in which 2 different jsp r loaded.....one of them has a logout link....wht i want is to click on the logout link closes the main jsp page that contains both of them and opening another jsp for the logout...in a totally new window.....might b the problem is now more clear and have a quick solution..
You wont get a quick solution for the reason's I've already outlined. You'll need to redesign the entry to your website so that the main window is lanched using JavaScript (in order to close the main window) and accept that popup blockers / security rules might interfere with what you want to do.
Regardless of whether your page is JSP/ASP/PHP/HTML and whether you have no frames or 75 frames, th questions you want the answers to are:
- Can I close the current browser window?
Only if you opened it from script on your site, or if you're targetting browsers that ignore the rules for window ownership. Even if you 'own' the window; you may hit security problems in certain browsers, especially on high security modes.
- Can I open a new browser window without ever hitting a popup blocker?
No.
Regardless of whether your page is JSP/ASP/PHP/HTML and whether you have no frames or 75 frames, th questions you want the answers to are:
- Can I close the current browser window?
Only if you opened it from script on your site, or if you're targetting browsers that ignore the rules for window ownership. Even if you 'own' the window; you may hit security problems in certain browsers, especially on high security modes.
- Can I open a new browser window without ever hitting a popup blocker?
No.
Plato forgot the nullahedron..
•
•
Join Date: Jan 2007
Posts: 37
Reputation:
Solved Threads: 3
I agree with Matt, why would you go all that trouble just for the logout. If you're worried about the back button on the browser, why don't you just put security measures on your pages like checking for sessions/cookies that you set when you login. If their sessions/cookies expire then warn the users and ask them log back in. Most if not all websites with logins do the same thing and they dont have problems with it.
![]() |
Similar Threads
- Open.window popup (JavaScript / DHTML / AJAX)
- Popup window (ASP.NET)
- opening in a new window... (Site Layout and Usability)
- Make An Asp Popup Window--help Me About This... (JavaScript / DHTML / AJAX)
Other Threads in the HTML and CSS Forum
- Previous Thread: Web page jumping down when browser window is shortened
- Next Thread: Spacing problems in Ie Gettting extra spacing between divs
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






