/    Sign up×
Community /Pin to ProfileBookmark

how to capture onClose event in IE

hi,

plz tell anybody how to fire a function on closing the IE browser

thanks ,
madhup Ranjan

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@mrhooMar 07.2007 — window.onunload=function(){}
Copy linkTweet thisAlerts:
@KorMar 07.2007 — U may also use [B]onbeforeunload[/B] event
Copy linkTweet thisAlerts:
@madhupauthorMar 08.2007 — hi marhoo,

it should fires only after closing the window not after refreshing that page.

thanks,

madhup
Copy linkTweet thisAlerts:
@Jeff_MottMar 08.2007 — t should fires only after closing the window not after refreshing that page[/quote]To the best of my knowledge, no browser lets you distinguish [i]how[/i] the page is being left. Whether clicking a link, closing the window, or merely refreshing, all you can know is that the page is being left.
Copy linkTweet thisAlerts:
@KorMar 08.2007 — From the browser's point of view, there is only a single action, [B]closing the session[/B]. Therefore a browser's interpretor can not distinguish between closing, refreshing, or going to another page.
×

Success!

Help @madhup spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...