Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Backbone.js and Jquery

I'm just getting started with backbone, based on what I read, I couldn't tell the difference. Here is a description from backbone's website

Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.

Doesn't jQuery do event binding, etc nicely already?

What purpose does backbone serves?

like image 654
William Sham Avatar asked Sep 23 '26 04:09

William Sham


2 Answers

What purpose does backbone serves?

Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.

jQuery is a DOM manipulation library.

Backbone allows you to organize and structure your code into data and presentation.

It also gives you access to _ which has an awesome set of functional utilities and it hooks up your data to a REST API.

like image 123
Raynos Avatar answered Sep 26 '26 01:09

Raynos


Backbone is more of an organizational framework and helps you organize your application in an mvc pattern. It is not a utility set or a toolkit and as such does not provide you actual functionalities and as such it does not enable you do more things which you couldnt already do with jquery. Rather it provides some some pre-defined objects Model, Collection,Controller etc. which you can conveniently extend to set up your application according to an opinionated MVC pattern. On top of that it provides a client side routing functionality which serves a dual purpose of providing a navigational facility as well as backbutton support without having to meddle with the History api.

like image 29
lorefnon Avatar answered Sep 26 '26 02:09

lorefnon