Help - Search - Members - Calendar
Full Version: CLosing Parent Window on Child Window open?
HTMLHelp Forums > Programming > Client-side Scripting
David_Hayden
I'm trying to do one of two things;
a.) Have the new page open in the current browser window
b.) failing that, have the original page close once the new page is opened.

I've seen a couple of scripts that will do the above, but I'm not sure how to work that into the current links I have which also keep things like the toolbar, menubar, scrollbars, etc from showing up (the link code is listed below).

<a href="java script://" onclick="java script: window.open('http://www.geocities.com/david_hayden_cj/course_template_page_2b.htm','newwindow',config='height=700,width=1100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no')"><img src="previous_arrow.gif"></a>

Any suggestions?
Darin McGrew
My advice? Here you go:
  • Don't use href="java script:..." links. Use the HREF attribute for a real URL.
  • Stop trying to muck with the browser (toolbar, menubar, scrollbars, etc.). It isn't your browser.
  • Just use normal links and the page will open in the current browser window, assuming the user doesn't choose to open it in a new window/tab.
Brian Chandler
What you're trying to do is called vandalism. Here's a bit of help for Firefox users:

In Edit > Preferences > Content, enable Javascript, then go to the "Advanced" button for Javascript, and turn off everything - resizing windows, interfering with context menus, etc. This will allow useful scripts, but stop practically all stupid web tricks.

Oh, and if a popup window announces you've won the lottery, rush off quick to collect your money! <g value=not>
David_Hayden
QUOTE(Darin McGrew @ Aug 8 2007, 08:46 PM) *

[*]Stop trying to muck with the browser (toolbar, menubar, scrollbars, etc.). It isn't your browser.
[/list]


Actually it is, or more precisely it's the company's browser, as this is for an internal training course and not a public web application. But I appreciate your other advice - using the JavaScript to set the initial window parameters and then relying on regular HTML links seems to be the solution I was looking for. Thanks for your help!
David_Hayden
QUOTE(Brian Chandler @ Aug 9 2007, 02:08 AM) *

What you're trying to do is called vandalism. Here's a bit of help for Firefox users:

In Edit > Preferences > Content, enable Javascript, then go to the "Advanced" button for Javascript, and turn off everything - resizing windows, interfering with context menus, etc. This will allow useful scripts, but stop practically all stupid web tricks.

Oh, and if a popup window announces you've won the lottery, rush off quick to collect your money! <g value=not>


So those lottery pop-ups aren't real? Damn........ blush.gif

Not so much trying to vandalize innocent users browsers as create an internal training course, and the navigation and menus aren't really necessary or helpful. Thanks though.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.