Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Interactive Web Pages with JavaScript JavaScript and the DOM Why JavaScript?

Leon Morris
Leon Morris
11,014 Points

Why JavaScript over JQuery with webpages?

I'm just interested to get some insight to how other people develop interactive web pages. What's the advantage of using actual JavaScript over jQuery?

I understand that everyone seems to absolutely love JavaScript at the moment, but i'm just intrigued as to why I shouldn't just use jQuery? It seems alot easier...

Cheers guys!

1 Answer

Kevin Korte
Kevin Korte
28,148 Points

The only real reason is the cost of including jquery, which can be very minimal. Make no mistake, jquery is a library written in javascript, its still javascript, it still doesn't work if the user disables javascript in their browser, jquery just gives us a simplier syntax to do many common tasks we as developers want to do. It's really just an api for javascript when you think about it.

But jquery has weight, it's another http request, it's another file the browser must download, and than parse.

However, jquery is so popular, that I'm a big fan of using google's cdn to host jquery on my site as my primary, because if a users has already visited another site that used google's cdn to host the same version of jquery like me (and there is a decent chance of that), than when they hit my site, the browser will used it's cached version of jquery, giving my site a nice little performance bump. May only save milliseconds, but that starts to add up when we're looking for load times of less than one second.

Leon Morris
Leon Morris
11,014 Points

Thanks for your reply, really useful point!