Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Feedback on: irt.org FAQ Knowledge Base Q845, July 20, 2000 at 13:31:47:

You are here: irt.org | About | Feedback | 1512 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q845

Sent by
Adam Edell on July 20, 2000 at 13:31:47:

Worth reading


This was exactly my question, too! What in the world is the:
window.onerror = supressError for??? Is this essential??

I love your site and your solutions... by the way... now that I've flattered you... you seem to have provided a script that does not take advantage of other useful tips you give elsewhere... I'd like you to consider this solution which combines the best of everything I think: compatiblity with the widest range of browsers. I'd love your opinion because I haven't been able to test it in IE3 or NS2,3 yet but it should degrade nicely... It works in IE5 and NS4.x, and functions well even if JavaScript is disabled...

The question was "Q845: From the main window I open a smaller child window, in this child window, if a user selects a link, I want to load the new page in the main browser window and close the child window. How do I do this?"

Here are the scripts:

In the main window:

<script language=JavaScript>

<a href="popup.html" target="mywindow" onClick="openawindow();return false">click here</a>

Notice that I use regular HTML links and override them with onClick... then I use return false for IE5 to not link to the HTML link... this is the MOST compatible I can think of...

Here is the script and HTML for the popup window (all links are regular HTML!)...

if (document.images)
opener.name = "mainwindow"
function closewindow(){
if (document.images){
if (!opener.closed)
return true

<a href="http://www.yahoo.com" target="mainwindow" onClick="return closewindow()">go to yahoo in main window></a>

Notice that I set this script to be JavaScript but limit all functionality to those where document.images is true. I think this is the best idea for graceful degradation... Earlier browsers should simply ignore the onClick and open a new window nicely... the only problem is with IE3 which I'm not sure how it will react... I'm gonna dig up a copy... Also, I add the timeout for Netscape compatiblity... (IE doesn't need any timeout...) Also, I use the onClick="return closewindow()" even though it does not seem to need a "return" to work nicely...

The only remaining question still remains, what's the:

window.onerror = supressError for???

Love your site!

Other feedback on 'irt.org FAQ Knowledge Base Q845' - show all

©2018 Martin Webb