Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can jQuery be relied upon?

Tags:

jquery

I'm doing a piece of jQuery code that will change the attributes within hundreds of HTML elements.

Can jQuery be relied upon entirely to perform such tasks?

Is there a chance that jQuery code would leave my page inconsistent?

EG. By not quite completing the task that I expect it to.

like image 307
Luke Avatar asked Jun 12 '12 07:06

Luke


2 Answers

In my sole opinion, I would trust jQuery even in mission critical applications. It's quite stable and never failed me in massive web applications.

You only need to be really careful when you update, as if you are using 3rd Party plugins, they might be not stable or fully compatible with fresh jQuery releases.

like image 182
Oliver M Grech Avatar answered Nov 10 '22 23:11

Oliver M Grech


Yes, it will perform the complete task. However, it might get a bit slow since you are talking about hundreds of elements. This might cause the browser to go into some kind of safe mode (telling the user a script is running slow and such).

Therefore, you might want to test how far you can go with it or use a different approach. Maybe some timeout construction where you do it piece by piece.

like image 27
Bas Slagter Avatar answered Nov 10 '22 22:11

Bas Slagter