HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 20th, 1999, 09:51 AM
christine
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I have opened a new window with the following link:

<A HREF="page2.htm" TARGET="new">Page 2</A>

How can I place a button on the new page which will close the new window?

Thanks.

Reply With Quote
  #2  
Old April 20th, 1999, 10:28 AM
scollo
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
In page2.html:

<INPUT
type=button
value="Close"
onClick="self.close();"
>

Reply With Quote
  #3  
Old April 23rd, 1999, 10:51 AM
christine
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
URLThanks.

My problem was that page2.html contained a frameset, and the document containing my close button was in one of the frames.
I was using onClick="close();", which worked not at all, but after reading your answer it's finally occurred to me to use onClick="parent.close();", which works perfectly.

[This message has been edited by christine (edited 04-23-99).]

Reply With Quote
  #4  
Old April 26th, 1999, 03:46 AM
nico
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
another solution in case you don't want to use a button to close it, but anything like a text link or an image:

<a href="javascript:window.close()">close me</a>

just in case you wanted to know URL

Reply With Quote
  #5  
Old December 11th, 2000, 12:27 AM
kprag kprag is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 20 kprag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Do any of you know how to close a window without having a pop-up window?

I have an html page that I would like to have close after clicking a link on that page and having a new window open. I was thinking that I might be able to put a <base href="" name=""> and have the javascript be like <input onclick="NewWin.close("name of window");" type="button" value="Close New Window"> This doesn't seem to work, however.

Do any of you know how to get this to work?

Reply With Quote
  #6  
Old December 11th, 2000, 05:33 AM
RedFox RedFox is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 45 RedFox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
I think you'd have to do that via a JavaScript. Let me see if i can get something together later on... busy right now

Reply With Quote
  #7  
Old December 14th, 2000, 02:46 PM
finelineBob finelineBob is offline
Senior Meddler
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: NY NY USA
Posts: 142 finelineBob User rank is Private First Class (20 - 50 Reputation Level)finelineBob User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to finelineBob
kprag, there are a number of ways you can close a window when opening another, but there is one gotcha (at the end):

1. in the window to be closed:
<body onblur="window.close()"

2. in the page that loads into the new window:
<body onload="opener.close()">

plus, depending on how you open the new window, you can use variations on the close() method (like "self.close()") in the link that triggers the event.

The gotcha is that if you try to close a window that was not opened by through a window.open() (in other words, the first window that opens when the browser launches or any window opened with the File > New menu command) will pop up a little security alert box asking for confirmation on closing the original window.

Cheers,
Bob

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > close button


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT