javascript - How to call HTML files from json to load them in a template -
i working on project displays html content json file. based on id, content of page displayed.
it tedious write html content inside json, how can avoid , maintain separate html files , call them based on id's in json file
{ "id": 0, "name": "1st page", "type": "info", "content": [ "<h2>heading</h2>" ], "active": false } the content loads in template :-
<h1>template 1</h1> {{{content}}}
you can load html files in element using jquery:
$( "div" ).load( "test.html" );
Comments
Post a Comment