[jQuery] Re: Validation: Which and why...

2009-01-07 Thread Will Anderson
I choose to validate from PHP because of a couple things. 1. It's more secure because nobody can see my PHP code, but they can see my jQuery code. 2. If the user has JavaScript disabled, or for some other reason the jQuery is unable to validate the code, it will still be validated. On the other

[jQuery] Re: is accessing element by a class faster than accessing X element by ID

2009-01-05 Thread Will Anderson
I think comparing two strings would be faster than deciding whether a string begins with another string. Also, doing one selection would almost always be faster than doing 3, so I'd say that the first piece of code from the OP would be faster. It should only require one loop through the DOM tree.