I'm including a <script> tag in my HTML page which contains a fragment of HTML. I want to get this fragment and insert it into the page. The location of the fragment is on the same server as the page itself, so there are no cross-site issues.
<script id="frag" src="/frag.html" type="text/x-jquery-tmpl"></script>
(btw, I've specified the type of the script as text/x-jquery-tmpl as I've been trying to use jQuery templates to access the script content, even though it's just an HTML literal). I believe the value of 'type' is not a big deal.
Some things I've tried:
// Try inserting frag.html into div hdr
// this attempt, using jQuery templates, doesn't work
$('#frag').tmpl().appendTo('#hdr');
// This is an empty string
var contents = $('#frag').text();
Sorry for all the jQuery, I have even less idea of how to attempt this without it. I'm a javascript ignoramus and need the fluffy protection of jQuery at all times.