Solved

OnUnload for a frameset

Posted on 2000-05-04
5
947 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This article discusses how to implement server side field validation and display customized error messages to the client.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

623 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