Questions tagged [backbone.js]

Backbone.js is a JavaScript framework with a RESTful JSON interface and is based on the model–view–presenter (MVP) application design paradigm

Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich of enumerable functions, views with declarative event handling, and connects it all to your existing API over a interface.

Its only hard dependency is Underscore.js, and as such some questions and answers tagged Backbone.js may in fact pertain to specifics. As an alternative, Lodash is also supported.

It also depends on jQuery, but supports Zepto.

Resources

Books

20658 questions
538
votes
3 answers

What does `void 0` mean?

Reading through the Backbone.js source code, I saw this: validObj[attr] = void 0; What is void 0? What is the purpose of using it here?
Randomblue
  • 98,379
  • 133
  • 328
  • 526
468
votes
7 answers

Explanation of

I just stumbled upon something I've never seen before. In the source of Backbone.js's example TODO application (Backbone TODO Example) they had their templates inside a , which contained code that looks like…
Matt
  • 19,783
  • 24
  • 71
  • 113
450
votes
15 answers

What is the purpose of backbone.js?

I tried to understand the utility of backbone.js from its site http://documentcloud.github.com/backbone, but I still couldn't figure out much. Can anybody help me by explaining how it works and how could it be helpful in writing better JavaScript?
sushil bharwani
  • 27,522
  • 29
  • 88
  • 122
405
votes
21 answers

JavaScript console.log causes error: "Synchronous XMLHttpRequest on the main thread is deprecated..."

I have been adding logs to the console to check the status of different variables without using the Firefox debugger. However, in many places in which I add a console.log in my main.js file, I receive the following error instead of my lovely little…
Nathan Basanese
  • 7,464
  • 8
  • 32
  • 61
371
votes
18 answers

Separate REST JSON API server and client?

I'm about to create a bunch of web apps from scratch. (See http://50pop.com/code for overview.) I'd like for them to be able to be accessed from many different clients: front-end websites, smartphone apps, backend webservices, etc. So I really want…
sivers
  • 3,823
  • 3
  • 12
  • 7
270
votes
15 answers

Serialize form data to JSON

I want to do some pre-server-validation of a form in a Backbone.js model. To do this I need to get the user input from a form into usable data. I found three methods to do this: var input = $("#inputId").val(); var input =…
dev.pus
  • 7,047
  • 12
  • 34
  • 49
248
votes
1 answer

What are the key differences between Meteor, Ember.js and Backbone.js?

Learning Ember.js / Backbone.js has been on my to-do list for a while. Now that Meteor is out, I am just wondering if anyone with experience of Meteor, Ember.js and Backbone.js can summarize the key differences and pros and cons of these three…
K Z
  • 26,597
  • 8
  • 65
  • 77
243
votes
8 answers

How to use if statements in underscore.js templates?

I'm using the underscore.js templating function and have done a template like this: