How to handle initializing and rendering subviews in Backbone.js?

I have three different ways to initialize and render a view and its subviews, and each one of them has different problems. I’m curious to know if there is a better way that solves all of the problems: Scenario One: Initialize the children in the parent’s initialize function. This way, not everything gets stuck in … Read more

How to use if statements in underscore.js templates?

I’m using the underscore.js templating function and have done a template like this: <script type=”text/template” id=”gridItem”> <div class=”griditem <%= gridType %> <%= gridSize %>”> <img src=”https://stackoverflow.com/questions/7230470/<%= image %>” /> <div class=”content”> <span class=”subheading”><%= categoryName %></span> <% if (date) { %><span class=”date”><%= date %></span><% } %> <h2><%= title %></h2> </div> </div> </script> As you can see … Read more

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

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

Separate REST JSON API server and client? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago. Improve this question I’m about to create a bunch of web apps from scratch. (See http://50pop.com/code for overview.) I’d … Read more

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 handwritten messages to myself: Synchronous XMLHttpRequest on the main thread is … Read more

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 <script type = “text/template”></script>, which contained code that looks like something out of PHP but with JavaScript tags. Can someone explain this to me? Is this legit? 7 s … Read more