Old 13-02-2008, 00:26   #1 (permalink)
benbailey
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.
  Reply With Quote
Old 13-02-2008, 10:22   #2 (permalink)
proc355
Trailer Trash™
 
proc355's Avatar
 
Join Date: Sep 2006
Location: Glasvegas
Posts: 871
1) ask your programmer
2) pay me instead, i know what i'm doing
__________________
meh.
  Reply With Quote
Old 13-02-2008, 11:14   #3 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 815
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by benbailey
I imagine AJAX would come into this but then again these pages have been around since before the popular use of AJAX.
The fundamental technology behind AJAX, XMLHttpRequest, is fairly old and has been in use for a long time. The hype surrounding AJAX in the past 2 years or so has simply brought it to light in a more predominant way.

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
__________________
  Reply With Quote
Old 13-02-2008, 11:41   #4 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,524
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.
  Reply With Quote
Old 13-02-2008, 12:43   #5 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 815
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
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
__________________
  Reply With Quote
Old 13-02-2008, 18:25   #6 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,672
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.
  Reply With Quote
Old 14-02-2008, 05:12   #7 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 815
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
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
__________________
  Reply With Quote
Old 14-02-2008, 18:39   #8 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,672
Quote:
Originally Posted by MikeMackay
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

Do you always assume every comment made every thread is about you?
  Reply With Quote
Old 14-02-2008, 23:13   #9 (permalink)
proc355
Trailer Trash™
 
proc355's Avatar
 
Join Date: Sep 2006
Location: Glasvegas
Posts: 871
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.
  Reply With Quote
Old 15-02-2008, 04:04   #10 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,672
Quote:
Originally Posted by proc355
i can't believe i'm the only one that takes issue with a question framed in the manner of the OP.

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:
i apologise for neglecting the opportunity for public cerebral masturbation.

Oh really? You seemed happy to post a load of wank earlier.

Last edited by Hunch : 15-02-2008 at 04:15.
  Reply With Quote
Old 15-02-2008, 07:20   #11 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 815
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by Hunch
Do you always assume every comment made every thread is about you?
Duly noted.

- Mike
__________________
  Reply With Quote
Old 15-02-2008, 16:45   #12 (permalink)
proc355
Trailer Trash™
 
proc355's Avatar
 
Join Date: Sep 2006
Location: Glasvegas
Posts: 871
Quote:
Originally Posted by Hunch
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.



Oh really? You seemed happy to post a load of wank earlier.


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.
  Reply With Quote
Old 15-02-2008, 17:42   #13 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,672
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.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8