/    Sign up×
Community /Pin to ProfileBookmark

How to make a "please wait …" popup??

Hello.

Lately I’ve been looking for a method or trick to make a “please wait while it loads/saves….” page.
I have a script used to register users for our wisp that does a lot of stuff after adding it the info to mysql and it takes a while to load the result page. I would like to add something where it says is “working or saving” and then display the result page after doing all the stuff.

I’ve done some googling and found a lot of stuff but, not really used for server-side pages.

Please enlight on this since, I’m very confused on what and how to implement this.

Thanks in advanced for your help and time.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@tirnaAug 15.2010 — One way to do it is:

1) On your page containing the registration form have a <div>, hidden by default, which contains your "Please wait..." content.

2) When the user clicks the submit button, send an ajax request with all the form data to a server side script to register the user in the database.

3) When the ajax request is sent, unhide the div in 1) using javascript.

4) When the ajax request is complete, hide the div in 1) using javascript and then display a message in a container somewhere on your page letting the user know their registration was successful or unsuccessful.

Instead of a using a div in 1), you could use a suitably sized new window to display the "Please wait.." message using window.open() in 3) and closing the window in 4). It's your choice.
Copy linkTweet thisAlerts:
@Declan1991Aug 16.2010 — Unless you specifically need to wait for the script to run to load the page (i.e. that you are waiting for confirmation that they have been added successfully), you might be better off running the script that takes a long time in the background, and just returning the page and allowing the user to get on with it. I can't find the original article where I saw this idea, but that's the gist anyway. The important things are that it is suitable when a process that does not have to happen immediately (i.e. adding a post to a thread or something like that), can happen in the background while you return a page to the user.
×

Success!

Help @landysaccount 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.18,
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,
)...