[SLUG] This week's project
Stephen O'Neill
soneill84 at yahoo.co.uk
Thu Jun 8 10:55:25 BST 2006
john at johnallsopp.co.uk wrote:
>> Stephen O'Neill wrote:
>>> +/-
>> Wow - Firefox converts
Oops - I meant Thunderbird.
> I find it weird that you did it in javascript rather than PHP for
> exactly these kinds of reasons. But then I just prefer PHP and I think
> you have a lot more experience of JS than I do/have.
It started out in PHP, which was somewhat faster. But I wanted to be
able to nudge the figures around without reloading the whole page.
Javascript is quite good but it has some irritating implicit type
conversions which can catch you out when doing sums.
I think my biggest irritation when writing it in JS was the browsers -
due to the number of form fields I had to use document.getElementById()
rather than being able to iterate through the form's elements because of
a bug I couldn't solve in IE.
That in turn made it slower because document.getElementById() seems to
be a rather slow way to access the DOM, especially when multiplying it
up through a large number of elements.
However, despite all this the PHP solution was held back by the same
thing - whilst the server could do all the maths the browsers still like
to take a moment to think about it when rendering lots of form fields.
Steve O
___________________________________________________________
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
http://uk.docs.yahoo.com/nowyoucan.html
More information about the Scarborough
mailing list