javascript - typeerror: 'undefined' is not a function even when using jQuery.noConflict -


I continue TypeError for the Handlebars.compile () call. I tried to add jQuery.noConflict () to various places suggested in some other positions, but luck did not. TypeError: 'undefined' is not a function (evaluation 'Handlebars.compile (' test ')')

The code is:

  $ ('. Location-typeahead'). Typeahead ({name: 'states', displayKey:' value ', source: states (), templates: {header:' & lt; h4 class = "location-typeahead-header" & gt; title & lt; / h4 & Gt; 'Suggestion: Handlebars.compile (' test ')}});  

If I remove that entire "suggestion" template parameter, then my JS works fine.

You have included the runtime version of Handlebars. If you want to compile the client side template, you must include the full version.

Alternatively, you can pre-compile your template - then you only need runtime.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -