KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've looked around a ton, and can't find an answer to this issue. I'm trying to take a local JSON file, load it up using Backbone.js and render it to a template in the browser. My file downloads, and the template appears, but it is never populated by the data. Any thoughts? Thanks in advance. HTML <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>People list</title> <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.1.1/css/bootstrap.min.css"> </head> <body> <div class="container"> <h1>People list</h1> <hr /> <div class="page"></div> </div> <script type="text/template" id="people-template"> <table class="table striped"> <thead> <tr> <th>First Name</th> <th>Last Name</th> <th>Age</th> <th>Photo</th> <th>Video</th> </tr> </thead> <tbody> <% _.each(PersonCollection, function(Person) { %> <tr> <td><%= Person.get("firstName") %></td> <td><%= Person.get("lastName") %></td> <td><%= Person.get("age") %></td> <td><%= Person.get("photo") %></td> <td><%= Person.get("video") %></td> </tr> <% }); %> </tbody> </table> </script> </body> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js" type="text/javascript"></script> <script src="http://cdnjs.
Tags (comma-separated)
Save Edits
Cancel