Solved

OnUnload for a frameset

Posted on 2000-05-04
5
901 Views
Last Modified: 2013-11-19
In frameset tag I have fired window.open method onunload event handler. It is working with explorer browser but not with Netscape navigator.
What might be the reason?? If I am giving other commands such as alert statement instead of window.open then it is working in Netscape also. Please give me a solution. It is showing that that "Illegal URL method" along with the url, which I want to try to open by window.open().
0
Comment
Question by:kprameela
5 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 2776543
In Netscape you cannor prevent a user from closing the browser, the same goes for the onunload. You cannot force the user, when he wants to quit a certain frameset (which is seen as closing the browser), to open up a new page.

A solution might be to use a function which opens up the new browser window or whatsoever. But big chance that that won't work...
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2776600
Netscape wants a complete url in the onUnload because often the knowlegde of the page like where it came from is already gone from memory.

<frameset onUnload="window.open('http://www.myserver.com/','newwindow')">

Michel
0
 
LVL 10

Expert Comment

by:kollegov
ID: 2776795
If you want not to allow to close window. I'd use the following:

<frameset onUnload="window.open(document.location,'newwindow')">

This will just reopen document again in new window.
( And this work :)

attempt to cancel  close window
is  what Netscape corporation consider 'bad practise' and therefore not allow to do.
I think you hardly will find any surfer on the net who consider this policy wrong...
0
 
LVL 3

Accepted Solution

by:
dplambert earned 200 total points
ID: 2778420
I built a simple frameset and tried an experiment. I was able to get the following piece of code to work in Netscape 4.72 and IE 5.0:

<frameset onUnload="window.open('test.html', 'newWin');">

When I hit reload (calls unLoad), it properly opened 'test.html' in a new window.

Your error message tells me that your event was handled. Perhaps you didn't correctly pass your parameters to the window.open() method.

It's:

window.open( URL, name, parameters );

For example:

window.open('http://www.test.com/test.html', 'newWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=600,height=400');
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2778491
DP: You are again answering with an answer that is already in the comments - please do not do that. Feel free to add comments and have your comments accepted as answers, but if there are already valid comments, please do not answer

Michel
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding a Li to a UL after a specified Li contents 2 46
angular2 2 way binding on load 7 39
alert before form submission 6 31
Javascript and Jquery not firing 9 42
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to count occurrences of each item in an array.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now