Closing a popup window and returning to main browser

J

~John Hemans~

Hi,
I'm using a popup window to show a series of pages. On the last page,
I need to close the window using a graphical button, return to the
main browser, and go to a new url.
I saw a posting on how to do this using a text hyperlink, but I can't
figure out how to do this using a graphic. Can someone help me? Here's
the text hyperlink I'm using below.

<A HREF="#" ONCLICK="opener.location='questionnaire.asp';self.close();return
false;">
Click me</A>
 
L

Lasse Reichstein Nielsen

1) There are those that believe that links shouldn't be links if it doesn't
link you anywhere.

I am one.
2) You can use a button and CSS to set its background image, and use its
onclick to do the same thing. Not widely supported though.

What do you mean by "not widely". Netscape 4 doesn't support the
button tag. All modern browsers do (it's basic HTML 4)

You can also do a
<input type="image" src="..." onclick="opener.location.href='..';self.close()">

The input element is very widely supported.

/L
 
L

Lasse Reichstein Nielsen

(e-mail address removed) (HikksNotAtHome) writes:

[input type="image"]
It falls in the "why use an element out of its context" argument. Or, am I
reading the spec wrongly?

You are correct. It is a submit button, and as such doesn't make any
logical sense outside of a form.
If "modern" support is all that is needed, wouldn't:
<img src="closeWindow.jpg" onclick="opener.location.href="....";self.close()">
Do the same thing?

Absolutely. The only reason for using the graphical submit button, is
to support NS4.

Can't you get NS4 to react to a click on an image too? (As many people
who try to make their images safe tries?)

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top