javascript - handlebars.js example jquery error -
can please tell me why handlebars.js example not work? jquery error?
typeerror: e null in jquery
looks happening here $(document).append(thetemplate(thedata));
<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="js/jquery-1.9.1.min.js"></script> <script src="js/handlebars.js"></script> <script type ="text/javascript"> $(document).ready(function () { var thedata = { headertitle: 'shop page', weekday: 'wednesday' }; var thetemplatescript = $("#header").html(); var thetemplate = handlebars.compile(thetemplatescript); $(document).append(thetemplate(thedata)); }); </script> </head> <body> <form id="form1" runat="server"> <div> <script id="header" type="text/x-handlebars-template"> <div> {{ headertitle }} </div> today {{weekday}} </script> </div> </form> </body> </html>
i changed jquery version 1.7.2 , fixed problem. still not sure changed in newer version
Comments
Post a Comment