- Best way to update a value dynamically
- Posted by Astra on February 24th, 2004
I may be posting to completely the wrong newsgroup, but I need to ask.
Basically I have created a shop cart that displays the current running total
in the header of my site so that it appears at the top of every page.
This value is updated when the customer adds to the basket, but the problem
is that this value is displayed before the basket routine calcs what the
running total is which makes it look a little silly as this value is always
out from the basket total when they do any changes.
I want to keep it at the top rather than put it at the bottom where I know
it will work, but I will lose the effect I am trying to create.
So what I'm basically asking is, do you know of a routine that can
dynamically go and change the header value once I have the basket total?
I was going to use .InnerText by putting the header value in a <SPAN
ID=xx>thevalue</SPAN>, but I have a feeling that this isn't as
cross-platform compatible as it should be. Am I right?
Any better ideas?
Rgds
Robbie
- Posted by GreyWyvern on February 24th, 2004
On Tue, 24 Feb 2004 17:30:33 -0000, Astra <info@NoEmail.com> wrote:
Okay...
Sounds good.
Are you using a server-side method to do this? If so, you're looking at
this the wrong way. All these calculations should be completed before the
page even *begins* to load. Move all your server side manipulations above
the <html> tag, polish up the totals and *then* display the page with the
completed variables.
Do it server-side, and make it clean even before the page begins to load.
Simple and efficient.
Grey
--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca RingMaker: PHP web ring creation and
management
- Posted by Laphan on February 24th, 2004
Thanks Grey
GreyWyvern <SP_bhuisman@greywyvern.com_AM> wrote in message
news
pr3vx8gjtv0in9v@news.nas.net...
On Tue, 24 Feb 2004 17:30:33 -0000, Astra <info@NoEmail.com> wrote:
Okay...
Sounds good.
Are you using a server-side method to do this? If so, you're looking at
this the wrong way. All these calculations should be completed before the
page even *begins* to load. Move all your server side manipulations above
the <html> tag, polish up the totals and *then* display the page with the
completed variables.
Do it server-side, and make it clean even before the page begins to load.
Simple and efficient.
Grey
--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca RingMaker: PHP web ring creation and
management
- Posted by Bill Logan on February 25th, 2004
"Astra" <info@NoEmail.com> wrote in message news:403b8b83$1_4@127.0.0.1...
of cake to put the new updated total anywhere you like on the page!


