Assign a text file to a js variable?
<p>Is there a way to assign a file like "info.txt" to a js variable so i can then set it to a div's inner html ?</p>

<p>This is currently what i have:</p>

<pre><code>texts = //load content of a text file (text file contains the html etc)
document.getElementById("main").innerHTML = text; //assign
</code></pre>

<p>Then i would have:</p>

<pre><code>&lt;div id="main"&gt;//content shows here&lt;/div&gt;
</code></pre>

<p>Is this possible ? I should mention i am not using a library. I want to learn to do it without one. Also does the text file require a set permissions type? And will it display HTML layout or just show it as text?</p>

<p>EDIT: The text file is on the same server :)</p>
