Michelle Michelle - 1 year ago 68
jQuery Question

Render PHP with jQuery instead of Handlebars?

I have already in my software Handlebars in using, but I'm not so familiar with it, so it is possible to render a PHP file instead of Handlebars file?

The code is:

loadFormTemplate = {
main: Handlebars.compile($('#load-form').html()),
error: Handlebars.compile($('#form-error').html()),
info: {
formBox: Handlebars.getTemplate('formbox')

Simple to edit name in getTemplate() of course. not works.

Answer Source

You can use jQuery .load() function to load a PHP file.

More info: http://api.jquery.com/load/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download