Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-01-2011, 10:05 PM   PM User | #1
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
Question Most common jQuery noob mistakes?

hey folks,
I'm working on a top 5 or top 10 list of the most common mistakes made by folks new to jQuery. The first most obvious ones I can think of:

- loading jQ more than once on the same page
- using more than one library without taking the correct precautions to prevent conflicts
- lack of knowledge of the power of jQuery selectors

my list is much longer but I want to get other people's opinion on the matter,

thanks!
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is online now   Reply With Quote
Old 12-01-2011, 10:57 PM   PM User | #2
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Quote:
Originally Posted by DanInMa View Post
I'm working on a top 5 or top 10 list of the most common mistakes made by folks new to jQuery.
In my experience, the most common mistake noobies to jquery make is not learning the fundamentals of javascript first. Not having a grasp of the basic principles of javascript means they will most likely be floating around in forums forever looking for someone to drag them out of the "coding quicksand" they will most likely keep falling in.

The second most common mistake is that they think jquery can be a shortcut to client side functionality - see above why it isn't.

The 3rd most common mistake is that they think that to perform a given task, jquery will need less code. That's a load of baloney. If they look at the "back end" code jquery runs to perform a task it will very most likely be quite a bit more than the amount of plain javascript code it would take to perform the same task.
webdev1958 is offline   Reply With Quote
Old 12-02-2011, 12:24 AM   PM User | #3
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,602
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
One of the most common jQuery n00b mistakes is that they just copy and paste together random scripts they found on the internet because they just found something that looked good visually, and then they have no idea why it’s not working.

And your first two points, Dan, are actually just a result of that.

jQuery is super practical and comfy but it also tempts to overuse and not understand it.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 12-02-2011, 01:59 AM   PM User | #4
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
Well this is a good start.

While you make great points webdev, I'm aiming more from the perspective of us pro jQuery folks . I understand it has it's pro and cons, which are defintely valid. My goal is to whittle it down to the top 10 or so common mistakes of beginners, and provide links to documentation , multiple examples etc..
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is online now   Reply With Quote
Old 12-02-2011, 02:06 AM   PM User | #5
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Quote:
Originally Posted by DanInMa View Post

While you make great points webdev, I'm aiming more from the perspective of us pro jQuery folks ..
oh, ok.

Your op wasn't clear, so I assumed you were referring to "nooby" noobies to jquery.
webdev1958 is offline   Reply With Quote
Old 12-02-2011, 12:18 PM   PM User | #6
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Most common mistakes from jQuery noobs from my perspective (in no specific order) are:

Sometimes they
1. don't know about $(document).ready(function()) / $(function())
2. try to bind event handlers to not-yet-existing elements without using .live() / .delegate() / .on()
3. don't get the meaning of "asynchronous" and "callback" for Ajax or other similar constructs
4. don't know that they need to include jQuery in an additional <script> tag
5. expect dragged elements to be physically (DOM-wise) inside the droppable container automatically after jQuery UI drag/drop
6. don't understand the difference between a DOM element and its "jQuery representating object"

EDIT
7. don't know the difference between setter and getter methods and that generally only setter methods can be used for chaining with the original jQuery object whereas getters change the object

Last edited by devnull69; 12-02-2011 at 12:38 PM..
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:54 PM.


Advertisement
Log in to turn off these ads.