{"action":"created","issue":{"url":"https://api.github.com/repos/assemble/assemble.io/issues/146","repository_url":"https://api.github.com/repos/assemble/assemble.io","labels_url":"https://api.github.com/repos/assemble/assemble.io/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/assemble/assemble.io/issues/146/comments","events_url":"https://api.github.com/repos/assemble/assemble.io/issues/146/events","html_url":"https://github.com/assemble/assemble.io/issues/146","id":84788418,"number":146,"title":"ajax and handlebars.","user":{"login":"harish2rock","id":3128292,"avatar_url":"https://avatars.githubusercontent.com/u/3128292?v=3","gravatar_id":"","url":"https://api.github.com/users/harish2rock","html_url":"https://github.com/harish2rock","followers_url":"https://api.github.com/users/harish2rock/followers","following_url":"https://api.github.com/users/harish2rock/following{/other_user}","gists_url":"https://api.github.com/users/harish2rock/gists{/gist_id}","starred_url":"https://api.github.com/users/harish2rock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harish2rock/subscriptions","organizations_url":"https://api.github.com/users/harish2rock/orgs","repos_url":"https://api.github.com/users/harish2rock/repos","events_url":"https://api.github.com/users/harish2rock/events{/privacy}","received_events_url":"https://api.github.com/users/harish2rock/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-03T21:55:12Z","updated_at":"2016-02-28T19:43:07Z","closed_at":"2016-02-28T19:43:07Z","body":"I have an ajax call in my js file. How do I pass the response of this ajax call to an handlebars template ?\r\nSomething like this -\r\n\tvar raw_template = $('#simple-template').html();\r\n\tvar template = Handlebars.compile(raw_template);\r\n\t\t$.getJSON(\"/restful/fortune\", function(response) {\r\n\t\t\tvar html = template(response);\r\n\t\t\t$('#main').append(html);\r\n\t\t});\r\n\r\nThe handlebars template is defined in a hbs file (another handlebars file 'results.hbs') as -\r\n<script id=\"simple-template\" type=\"text/x-handlebars-template\">\r\n<div id=\"main\">\r\n<p>{{response.status}}</p>\r\n<p>{{response.fortune}}</p>\r\n</div>\r\n</script>\r\n\r\nAssemble is parsing the handlebars template as html itself. Can you please help me out ?\r\n\t"},"comment":{"url":"https://api.github.com/repos/assemble/assemble.io/issues/comments/189932345","html_url":"https://github.com/assemble/assemble.io/issues/146#issuecomment-189932345","issue_url":"https://api.github.com/repos/assemble/assemble.io/issues/146","id":189932345,"user":{"login":"jonschlinkert","id":383994,"avatar_url":"https://avatars.githubusercontent.com/u/383994?v=3","gravatar_id":"","url":"https://api.github.com/users/jonschlinkert","html_url":"https://github.com/jonschlinkert","followers_url":"https://api.github.com/users/jonschlinkert/followers","following_url":"https://api.github.com/users/jonschlinkert/following{/other_user}","gists_url":"https://api.github.com/users/jonschlinkert/gists{/gist_id}","starred_url":"https://api.github.com/users/jonschlinkert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonschlinkert/subscriptions","organizations_url":"https://api.github.com/users/jonschlinkert/orgs","repos_url":"https://api.github.com/users/jonschlinkert/repos","events_url":"https://api.github.com/users/jonschlinkert/events{/privacy}","received_events_url":"https://api.github.com/users/jonschlinkert/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T19:43:07Z","updated_at":"2016-02-28T19:43:07Z","body":"closing since this is probably a better question/discussion for stackoverflow. "}}