Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > using close window buttons on a refreshed page

Reply
Thread Tools

using close window buttons on a refreshed page

 
 
mcyi2mr3@lycos.co.uk
Guest
Posts: n/a
 
      11-01-2005
Hi all

I'm new to javascript and im trying to add a close button function to
my certain pages of my site. I use this code:

<a href='javascript:window.close();'>Close Window</a>

to create a hyperlink which closes the window. However with pages which
display data retrieved from a database using PHP i use a form to submit
a search on the page which displays results. At the bottom of the page
is the close window link, however it fails to work once a form has been
submitted on the page. It only works when the page first loads.

Any ideas guys on how i can get a close window option that works on my
results page after submitting a search?

Marc

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      11-01-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) said the following on 11/1/2005 3:39 PM:

> Hi all
>
> I'm new to javascript and im trying to add a close button function to
> my certain pages of my site. I use this code:
>
> <a href='javascript:window.close();'>Close Window</a>
>
> to create a hyperlink which closes the window. However with pages which
> display data retrieved from a database using PHP i use a form to submit
> a search on the page which displays results. At the bottom of the page
> is the close window link, however it fails to work once a form has been
> submitted on the page. It only works when the page first loads.
>
> Any ideas guys on how i can get a close window option that works on my
> results page after submitting a search?


<H1>To close this page, click the X in the upper right corner</H1>

Users know how to use the browser and it's built in mechanisms, stop
trying to reinvent the wheel and your problem will go away.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.mattkruse.com/javascript/bestpractices/
 
Reply With Quote
 
 
 
 
mcyi2mr3@lycos.co.uk
Guest
Posts: n/a
 
      11-01-2005
But still the unanswered question looms large in my mind, why does the
javascript not work when the webpage form is submitted?

 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      11-01-2005
(E-Mail Removed) said the following on 11/1/2005 5:29 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

> But still the unanswered question looms large in my mind, why does the
> javascript not work when the webpage form is submitted?
>


Who knows, without seeing a bare minimum sample page that displays the
behavior you describe, it is impossible to even guess.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to close a TCP socket? (TCPSocket#close doesn't close it) IƱaki Baz Castillo Ruby 7 01-12-2010 01:32 PM
perform an action when we close the window using the close tab at the top of the screen tapanreddy@gmail.com Javascript 4 04-10-2007 09:37 PM
an IE window with no minimize and close buttons =?Utf-8?B?TGluZGE=?= ASP .Net 4 10-05-2006 08:11 PM
close current window using window.close() Shang Wenbin Javascript 10 09-02-2005 12:16 AM
New window.name value doesn't stick. Old value returns unless the window is refreshed Diana Javascript 1 04-06-2004 12:09 AM



Advertisments