/    Sign up×
Community /Pin to ProfileBookmark

execute window.onunload event untill on condition

I have this requirement :-

onunload event I display a popup, and waits for closing of that popup, then want to continue with unload process.

I put an loop checking popup is closed or not, if not then loop still executes.
once popup closed loop breaks and onunload process gets continue.

This is working fine in IE, Firefox reports an warning “unresponsive script”.

there is one solution exists for avoiding this warning, since in my case this loop may excute undefinitely so firefox hangs up here.

IE is working fine with this code.

[B]I changed my approach like:-[/B]

onunload I displays popup. onclose of that popup I calls a parent window method (this method is having code that is going to excute after popup is closed).

[B]Problem with this Approach:-[/B]

since onunload is in process, after opening childwindow it doesn’t wait and my page is getting unload. so there is no point that parent window method will be called on child window close event.

I want to put an condition that unload process should wait untill popup is closed.

Please help.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@punesoftwareauthorJan 11.2008 — code looks like:--

window.onunload = function() {

// Open child Window

// wait here untill child window is closed [B][COLOR="Magenta"]What condtion should I put here except this loop[/COLOR][/B] //while(!childWindow.closed){

// }


}

function FinalSubmit(){

// this method is called when child window is closed

}
Copy linkTweet thisAlerts:
@punesoftwareauthorJan 11.2008 — do anybody has solution to this problem?
×

Success!

Help @punesoftware 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.16,
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,
)...