By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,872 Members | 2,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,872 IT Pros & Developers. It's quick & easy.

perform an action when we close the window using the close tab at the top of the screen

P: n/a
I am looking to perform an action when we close the window using the
close tab at the top of the screen.
I know how to do it using a close button but I was wondering if there
is way to achieve the above.
Waiting for some suggestions
Thanks

Apr 9 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Apr 9, 2:43 pm, tapanre...@gmail.com wrote:
I am looking to perform an action when we close the window using the
close tab at the top of the screen.
I know how to do it using a close button but I was wondering if there
is way to achieve the above.
Waiting for some suggestions
Thanks
No takers???? I would be glad if someone can guide me on the above.
Thanks again

Apr 9 '07 #2

P: n/a
ta********@gmail.com said the following on 4/9/2007 3:43 PM:
I am looking to perform an action when we close the window using the
close tab at the top of the screen.
I know how to do it using a close button but I was wondering if there
is way to achieve the above.
Waiting for some suggestions
Best suggestion you will read: Give up now. You have no way of knowing
why I left a page, and it is not even assured that you can know I left.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 9 '07 #3

P: n/a
On Apr 9, 4:44 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
tapanre...@gmail.com said the following on 4/9/2007 3:43 PM:
I am looking to perform an action when we close the window using the
close tab at the top of the screen.
I know how to do it using a close button but I was wondering if there
is way to achieve the above.
Waiting for some suggestions

Best suggestion you will read: Give up now. You have no way of knowing
why I left a page, and it is not even assured that you can know I left.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
r u sure sir? I know why I am leaving my page. But I am not sure about
the second question you put up.
Come on there has to be a way to know i closed my page!!!! other than
window.close().

Apr 10 '07 #4

P: n/a
ta********@gmail.com said the following on 4/10/2007 3:11 PM:
On Apr 9, 4:44 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
>tapanre...@gmail.com said the following on 4/9/2007 3:43 PM:
>>I am looking to perform an action when we close the window using the
close tab at the top of the screen.
I know how to do it using a close button but I was wondering if there
is way to achieve the above.
Waiting for some suggestions
Best suggestion you will read: Give up now. You have no way of knowing
why I left a page, and it is not even assured that you can know I left.
<snipped signature that shouldn't have been quoted to start with>
r u sure sir?
I am as positive as positive can get. Unless it has to do with my
negative energy to counter-act all the positive energy in the Universe
and thereby keeping it from collapsing upon itself.
I know why I am leaving my page.
You may know as a user why you left but you have no way of knowing as a
programmer why a person left. You can't even rest assured they left.
But I am not sure about the second question you put up.
Question? Second Question? I didn't even post one question much less two.
Come on there has to be a way to know i closed my page!!!! other than
window.close().
window.close() won't tell you the page closed, it will attempt to close
the page.

You can try onunload and onbeforeunload but they are not reliable.

Just when you think you have it figured out, open your page and unplug
your computer (simulating a power outage) and then let me know how you
know, as the programmer, that the page got closed.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 10 '07 #5

P: n/a
Ok thanks a bunch for your reply.
Let me be specific abt my problem
I need a link to appear on the parent window once the user has closed
the child window, this is all I need to accomplish.
Maybe you can better suggest me accomplish this task rather than being
too subjective with the original question.

Apr 10 '07 #6

P: n/a
Lee
ta********@gmail.com said:
>
Ok thanks a bunch for your reply.
Let me be specific abt my problem
I need a link to appear on the parent window once the user has closed
the child window, this is all I need to accomplish.
Maybe you can better suggest me accomplish this task rather than being
too subjective with the original question.
Maybe you can consider that people who choose to help you do so of
their free will, and that being a whiny jerk is not a good way to
win friends and influence people.
--

Apr 10 '07 #7

P: n/a
ta********@gmail.com said the following on 4/10/2007 5:19 PM:
Ok thanks a bunch for your reply.
And thank you for quoting, next time, what you are replying to.
Let me be specific abt my problem
I need a link to appear on the parent window once the user has closed
the child window, this is all I need to accomplish.
Set a timeout call that checks for the existence of the child window. If
it is there, remove the link. If the child window is closed, then show
the link:

var theChildWindow = window.open(...)

if (!theChildWindow){
//The window is closed
}

Look at the thread from the last few days of "why is this not working?"
for a discussion on setTimeout and how to use it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 10 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.