Elegant clean way to include HTML in JavaScript files?
<p>I'm building a small app with a few modal dialog windows.  The windows require a tiny bit of HTML.  I've hard coded the window HTML in the javascript library but am not thrilled with this solution.  Is there a more elegant way to do this?  It seems that JavaScript doesn't have multi line strings/heredoc syntax.  </p>

<pre><code>var html = "&lt;div id='email_window'&gt;&lt;h2&gt;Email Share&lt;/h2&gt;&lt;div&gt;";
html = html + "&lt;form action='javascript:emailDone();' method='post'&gt;";
html = html + "&lt;div&gt;&lt;label for='to'&gt;To&lt;/label&gt;&lt;input id='to' type='text'&gt;&lt;/div&gt;";
html = html + "&lt;div&gt;&lt;label for='from'&gt;From&lt;/label&gt;&lt;input id='from' type='text' value='" + email + "'&gt;&lt;/div&gt;";
html = html + "&lt;div&gt;&lt;label for='subject'&gt;Subject&lt;/label&gt;&lt;input id='subject' type='text' disabled='disabled' value='" + subject + "'&gt;&lt;/div&gt;";
html = html + "&lt;div&gt;&lt;label for='body'&gt;Body&lt;/label&gt;&lt;input id='body' type='text' disabled='disabled' value='" + body + "'&gt;&lt;/div&gt;";
html = html + "&lt;div&gt;&lt;input type='submit' value='Send'&gt;&lt;input type='button' value='Cancel' onClick='javascript:$.fancybox.close();'&gt;&lt;/div&gt;";
html = html + "&lt;/form&gt;&lt;/div&gt;";

$("#data").html(html);
</code></pre>

<p><strong>Added to clarify the original message-</strong></p>

<p>Any solution can't use Ajax/XHR to pull in the template file because the javascript library will be on a different domain that the html file it's included in
It's a little like ShareThis. The library will be included on a number of different sites and attached to the onClick event of any anchor tag inside divs with attribute sharetool="true".</p>

<p>For example:</p>

<pre><code>http://www.bar.com - index.html
&lt;html&gt;
...
&lt;script type="text/javascript" src="http://www.foo.com/sharetool.js"&gt;&lt;/script&gt;
...
&lt;body&gt;
&lt;div sharetool="true"&gt;
&lt;/div&gt;
...
&lt;/html&gt;
</code></pre>
