The icanhaz documentation uses this as an example as how to pull ich templates from a remote server.
$.getJSON('/myserver/templates.json', function (templates) {
$.each(templates, function (template) {
ich.addTemplate(template.name, template.template);
});
});
However, the documentation doesn't really tell you what the file on the remote server has to look like. Anyone have any ideas?
Your templates JSON object may look like this:
This will define a template for options in a select box.
You can add the template using the code you specified (actually I tweaked it slightly as I couldn't get it to work as specified):
For clarity, here is what options.json contains:
Do let me know how you get on :)