javascript - Getting error including handlebars.js -
i started playing handlebars.js , getting error within handlebars.js seems odd : "define not defined" . if can point out mistake, i'd appreciate it. below code snippet , below pix of chrome dev tools error.
<script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1>{{title}}</h1> <div class="body"> {{body}} </div> </div> </script> <script src="https://code.jquery.com/jquery-2.1.3.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.1/handlebars.amd.js"></script> <script> $(document).ready(function() { var source = $("#entry-template").html(); var template = handlebars.compile(source); }) </script>
any reason referencing amd file? if not here cdn not throwing error.
<script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1>{{title}}</h1> <div class="body"> {{body}} </div> </div> </script> <script src="https://code.jquery.com/jquery-2.1.3.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.1/handlebars.js"></script> <script> $(document).ready(function() { var source = $("#entry-template").html(); var template = handlebars.compile(source); }) </script>
Comments
Post a Comment