| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: May 2004
Location: Melbourne
Posts: 2
|
Creating a processing page
I am working with a Perl programmer on an asset management system. Anyone got any ideas on the smarts behind a "processing page". Eg. You've hit submit on a form and a page appears saying: "Your order is processing. Please don't hit refresh" etc etc. How is this archived? How does the system know how long to leave the page up and when to present a confirmation page once the processing has been completed? I imagine AJAX would come into this but then again these pages have been around since before the popular use of AJAX. Any insight appreciated. |
|
|
|
|
|
#3 (permalink) | |
|
Everything is fine.
|
Quote:
One possible solution could be to send the user to a 'Processing Order' holding page while using an XHR request in the background checking for the status of the order on the server. When it retrieves a completed or success status you could then forward the user to the confirmation page. Similarly you would forward the user on to an error page if the transaction failed. I'm not too sure how viable the above method is, but it's the first thing that came to mind. - Mike Mike Mackay: Web Developer - LinkedIn
|
|
|
|
|
#4 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 1,659
|
Is it really necessary though? I mean, the browser should show that some sort of interaction with the server is going on, letting the user know that their form is being processed. Scripts don't (or shouldn't) take *that* long to process, so it seems like kind of an unneeded expenditure of effort. to try to put up this processing screen. |
|
|
|
#5 (permalink) |
|
Everything is fine.
|
Good point haku. Yes it could well be a gratuitous step to perform. Depending on, of course, what you are processing the server should handle things with decent speed making this step unnecessary. Even the processing of Credit Card data via a 3rd party payment gateway usually only take a few seconds at the most. If you were performing cpu hogging processes such a zipping a large data file or something then I could understand the holding page might be useful. Or even perhaps showing the status of a mass mail-out or anything along those lines where it would be beneficial to the user to see the status of said process. Hopefully this will have given you some idea's on how to code or why to display or even if this step is justified. - Mike Mike Mackay: Web Developer - LinkedIn
|
|
|
|
#6 (permalink) |
|
Grumpy old man
Join Date: Oct 2007
Location: North Japan
Posts: 1,375
|
A perfectly sensible question. Rather than making flippant responses (usually a sign someone has no idea what they're talking about) or debating whether or not it's a good idea, let's actually look at how it works (which is what the OP asked). In AJAX, the XMLHttpRequest object has a property called onreadystatechange. Basically it's a value, which is updated as the request is processed. This allows the programmer to create an event handler, for example xmlHttp.onreadystatechange=function(), which triggers a function every time the state of the request changes. It's this function which handles the different messages displayed by the browser. That might not mean much to you if you're not a programmer, so in simple terms, when you make an AJAX style request to the server, the browser stores a value from 0 to 4 indicating the following: 0 - Request not initialized 1 - Request set up 2 - Request sent 3 - Request being processed 4 - Request complete An event handler is something which sits and listens for a particular change to happen in the state of the browser and triggers a bit of code to take care of it. So, after sending the request to the server, the state will be updated to '3' by the server to indicate the request is being processed, which is the time when the browser can trigger the function which creates the "processing - don't click refresh" page. When it gets to 4, the browser can then load the "completed" page. Last edited by Hunch : 13-02-2008 at 18:38. |
|
|
|
#7 (permalink) |
|
Everything is fine.
|
Easy there Hunch. First of all, I did offer some possible method of doing what the OP asked. I wasn't advising the OP to strictly avoid that step completely, I merely suggested that (depending on what processing was actually happening) it may not always be necessary whereas in certain circumstances (I even gave some examples) it would be beneficial to the end user. To be honest I don't feel that it was justified to comment about making 'flippant' responses, and to suggest that I have no clue as to what I'm talking about, seemed a little uncalled for. - Mike Mike Mackay: Web Developer - LinkedIn
|
|
|
|
#8 (permalink) | |
|
Grumpy old man
Join Date: Oct 2007
Location: North Japan
Posts: 1,375
|
Quote:
Do you always assume every comment made every thread is about you? |
|
|
|
|
#9 (permalink) |
|
Trailer Trash™
Join Date: Sep 2006
Posts: 851
|
perhaps aimed at me. no? i can't believe i'm the only one that takes issue with a question framed in the manner of the OP. i apologise for neglecting the opportunity for public cerebral masturbation. carry on. meh.
|
|
|
|
#10 (permalink) | ||
|
Grumpy old man
Join Date: Oct 2007
Location: North Japan
Posts: 1,375
|
Quote:
And what manner is that exactly. I'd love you to spell it out, because I certainly can't see what you're bothered about. If people can't come into the programming section of a web design forum and ask a perfectly polite, reasonable question about web programming, what the fuck is the point of it existing? I appreciate that this place is often pretty hard on newcomers and has a lot of cliquey in-jokes and piss-taking, but seriously, at least make the effort to separate the decent posters from the idiots. Don't just mock everyone for the sake of it. Yes, I think you have issues, but not with the OP. Quote:
Oh really? You seemed happy to post a load of wank earlier. Last edited by Hunch : 15-02-2008 at 04:15. |
||
|
|
|
#11 (permalink) | |
|
Everything is fine.
|
Quote:
- Mike Mike Mackay: Web Developer - LinkedIn
|
|
|
|
|
#12 (permalink) | |
|
Trailer Trash™
Join Date: Sep 2006
Posts: 851
|
Quote:
my my, aren't we the cunt. my issue? 2 post wonders asking questions on behalf of their (presumably remunerated) programmers; this isn't someone needing help, it's someone looking for a freebie—yes, i do have an issue with that. don't take issue with me because you can answer one fucking question and feel the need to massage your ego in public; instead, take a fucking pill and shut the fuck up. meh.
|
|
|
|
|
#13 (permalink) |
|
Grumpy old man
Join Date: Oct 2007
Location: North Japan
Posts: 1,375
|
Fair enough. I'm not going to get dragged into an argument over this because I don't think you have a leg to stand on. The guy asked a simple question about how a particular aspect of a web technology worked. There simply wasn't a request for a freebie. He said he's already working with a programmer and he wants some insight into how to go about it. I'll say it again: That's why forums like this exist. Are you seriously telling me that as a 'remunerated' programmer you have never in your life benefited from someone else explaining something to you? I know I have. It's bit rich therefore, to begrudge someone else the same. Honestly mate, I think you've genuinely misjudged this one. Last edited by Hunch : 15-02-2008 at 17:58. |
|
![]() |