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

20627 questions
593
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
  • 112,777
  • 145
  • 353
  • 547
454
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
  • 29,685
  • 30
  • 94
  • 128
418
votes
22 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
  • 8,475
  • 10
  • 37
  • 66
372
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,833
  • 3
  • 14
  • 7
305
votes
14 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,919
  • 13
  • 37
  • 51
250
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: