/    Sign up×
Community /Pin to ProfileBookmark

Ajax method before closeing window

I have an ajax method that I want to use to update a database. I want call this procedure before I click a button that closes the window (popup).

callAjax(something);
self.close();

However, when I do this, the server never gets hit with the ajax request (or it gets cancelled???) I just want to update a database with a value.

Help

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@rootJun 04.2007 — post & then wait for a server response THEN close your window...
Copy linkTweet thisAlerts:
@RobDavidauthorJun 04.2007 — No better way??? Its not a mission critical process, just preference gathering. I don't like the idea of waiting for a response before closing the window
Copy linkTweet thisAlerts:
@killerkingkong1Jun 04.2007 — wuz up nigga feeling good..............:eek: :mad: ? :p
×

Success!

Help @RobDavid 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...