Helllo, probably this is a common question, but I didn't find the appropriate answer.
I have an html file: header.html which contains a header which I want to display
Here is my Backbone.View
el: $(".header"),
initialize: function () {
this.render();
},
render: function () {
var template = _.template( $("#header_template").html(), {} );
this.$el.html( template );
},
When I put the code inside a java script template, it works:
<script type="text/template" id="header_template">
code of header.html goes here
</script>
But when I use it this way:
<script type="text/template" id="about_template" src="header.html"></script>
it stops working even though, the firebug sees the code inside a template.
Can someone tell me what my mistake is and how to solve it