Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.getJSON( "{% url 'characters:sheet_json' %}", function(obj) {
- refresh_timer = obj.refresh_timer * 1000;
- setTimeout(refresher, refresh_timer);
- if (obj.content) {
- // do shit with content and data
- var source = $("#SheetTemplate").html();
- var template = Handlebars.compile(source);
- var context = obj.content;
- var html = template(context);
- $("#SheetContent").replaceWith(html);
- }
- });
- };
- Mijn json object:
- {"content": {"charactername": "John Barra", "portrait_url": "/media/images/characters/93252880_200.jpg", "skillpoints": 11561858, "bloodline": "Civire", "corporationdate": "2013-10-16T09:53:00Z", "lastlocation": "X-4WZD", "race": "Caldari", "securitystatus": 0.767783748266338, "corporation": "Dry Atomic Fusion", "alliance": "Apocalypse Now.", "balance": 4799014.4, "history": [{"corporation": "Dry Atomic Fusion", "startdate": "2013-10-16T09:53:00Z"}, {"corporation": "Caldari Provisions", "startdate": "2013-10-15T19:19:00Z"}, {"corporation": "Dry Atomic Fusion", "startdate": "2013-09-27T17:00:00Z"}, {"corporation": "School of Applied Knowledge", "startdate": "2013-04-24T12:43:00Z"}]}, "refresh_timer": 300}
- als ik nu {{ charactername }} in mijn template gebruik dan werkt het niet. wat mis ik?
Advertisement
Add Comment
Please, Sign In to add comment