I’m experimenting with some page re-format scripting, and I’ve been using loadXMLDoc() to load in an html document into a javascript variable. From there I can use it in my coded re-formatting experiments, keeping it hidden until the script completes.
loadXMLdoc() works, but maybe it is unnecessary overhead? I’ve been reading about the different uses of the html <link> tag, on the developer.mozilla.org site, and I’m beginning to wonder if there might be a way to do the same thing with a simple <link> tag. Is it possible to use <link> to “load” in the contents of an HTML document, and have it remain unseen but available to subsequent javascript code? If I included a line, maybe like this?…
<link rel=”import” type = “text/html” href=”/someFile.html”>
maybe the linktype (‘rel)’ has to be something else, but in any case even if it worked, how would I access the content? Can I put an ID attribute in a link tag, and then access it through a simple “document.getElementById()” call?