473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Closing a popup window and returning to main browser

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>
Jul 20 '05 #1
7 6975
In article <d6**************************@posting.google.com >,
ad***@seotechnologies.com (~John Hemans~) writes:
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.


You do it the same way you make any other image a link:

<a href="#" onclick="self.close();return false"><img src="closeMe.jpg"
height="81" width="472" alt="Close The Browser"></a>

Notes:
1) There are those that believe that links shouldn't be links if it doesn't
link you anywhere.
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.
3) I see absolutely no use in return false in a link that closes the browser.
If the browser is closed, theres nowhere for it to navigate to.
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #2
hi************@aol.com (HikksNotAtHome) writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
In article <7k**********@hotpop.com>, Lasse Reichstein Nielsen <lr*@hotpop.com>
writes:
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)


Ooops, you are right.

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

The input element is very widely supported.
I though input type="image" submitted the form?
From <URL: http://www.w3.org/TR/html401/interac...-control-types

<quote>
Creates a graphical submit button
</quote>
It falls in the "why use an element out of its context" argument. Or, am I
reading the spec wrongly?

If "modern" support is all that is needed, wouldn't:
<img src="closeWindow.jpg" onclick="opener.location.href="....";self.close()" >
Do the same thing?
<shrug>
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #4
hi************@aol.com (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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5
Thanks for your help.
In my post I wanted to...

(a) Close the window that was open, then...
(b) Go to a different url automatically in the main browser.
Where in your code is the code section that automatically opens the new
url in the main browser screen? Can you re-post with this code included?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #6
In article <3f***********************@news.frii.net>, John Hemans
<ad***@seotechnologies.com> writes:
(a) Close the window that was open, then...
(b) Go to a different url automatically in the main browser.
Where in your code is the code section that automatically opens the new
url in the main browser screen? Can you re-post with this code included?


onclick="opener.location.href="someOtherURL.html;s elf.close()"

in whichever way you want to use it. So far, for NN4 compatibility, either use
an input type="image", or a link wrapped around an image tag.

<input type="image" src="closeWindow.jpg"
onclick="opener.location.href="someOtherURL.html;s elf.close()">

Or an image with a link:

<a href="noJS.html"
onclick="opener.location.href="someOtherURL.html;s elf.close()"><img
src="closeWindow.jpg"></a>
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #7
In article <y8**********@hotpop.com>, Lasse Reichstein Nielsen <lr*@hotpop.com>
writes:
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?)


The only way I have ever been able to allow a click on an image in NS4 is to
wrap it with a container that supports onclick. It simple doesn't support
onclick for the img tag :-(
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Noozer | last post by:
When using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window? This is what I've written in the NewWindow2 event,...
2
by: Jawahar Rajan | last post by:
All, I have a printer friendly page that is opened when a user clicks a link on my page to get the printer friendly version, How ever when they close out the printer friendly version and return to...
1
by: MJEASSOC | last post by:
I need some help with closing a popup window. I'm making an online portfolio, that has one base page with text and thumbnails. When a user clicks on a thumb, a new window opens containing a larger...
3
by: MEM | last post by:
Hello, I'd like to refresh the main or top most browser window from a child window. Specifically, child popup A is opened by a main browser window then child popup B is opened from within child...
1
by: Daniele Baroncelli | last post by:
Initial situation: main window of the browser display url A THEN - user click on a link (which also opens a popup on the onClick event) to url B
1
by: Bill H | last post by:
I run a dbms application that interfaces with the web. This module creates a frames page with two frames ('main' and 'mwinfoframe'). All communication with the dbms is routed through the...
26
by: Raffi | last post by:
Hi, We have a database application that runs in a popup Internet Explorer application window. The reason for this is to isolate the casual user from the address bar and the typical IE navigation...
7
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera...
14
by: fiziwig | last post by:
I was looking for a way to have a popup window appear when someone left my page, but not have it appear when they hit the refresh or back buttons on the browser. Since using onUnload="..." in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.