read txt file via client javascript
<p>I'm new to javascript and trying to open a txt file into var and then inject it to html div...
I tried to use fopen but I didn't succeed.</p>

<pre><code>&lt;script type="text/javascript"&gt;
file = fopen(getScriptPath("info.txt"), 0);


file_length = flength(file);
var content = fread(file,file_length);
var div = document.getElementById("myDiv");
//alert(div);
div.innerHTML = "";
div.innerHTML = content;
&lt;/script&gt;
</code></pre>
