javascript - Backbone script to read from external JSON -
I want to display data from JSON using a backbone script.
This is the html page:
This is my Jason data: document.json
[{"id": "p1", "name": "aaa", "title "", "Background": "FFFF"}, {"ID:" "P2", "Name": "DDDD", "Title": "EEE", " "Id": "P3", "name": "GGGG", "title": "hHHH", "background": "IIII"}] Giving page Am I missing something? I am trying to get printed JSON data on the div element in the specified HTML. But nothing is being displayed, I tried to debug the code, I could insert a warning statement inside the backbone.model.extend in the document .ready in jquery Am But when I made a vigilant statement inside it, it is not coming. Therefore, the code should go wrong somewhere within backbone.model.endend./ . Does anyone help me?
You need to check the order to load your scripts, jquery should come first, underscore second Talk (because you're using undescore.js templateing) then spinal cord:
If it does not resolve your problem, you can either try to send static reference to your initial set data, then make the necessary Fetch () call to fetch , Or you can clearly get the call:
var profileList = new ProfileList (); Var Profileview = New Profile View ({Collection: Profile List}); ProfileList.fetch (); ProfileList.bind ('reset', function () {profilesView.render ();});
Comments
Post a Comment