I'm trying to implement some code that will create the headers and footers on all of my web pages instead of hard coding them. I tried this:
I had this in my "main page" I just called wrapped the header I wanted in a div.
<div id="headerProto">
<div data-role="header" data-position="fixed" data-theme="b">
<h1> Title </h1>
</div>
</div>
Then in the other pages I had:
<div class="headerChild">
</div>
And I added:
$(".headerChild").html($("#headerProto").html());
No dice. Either way that was a total guess on how I'm supposed to do it. Is there a better way?