How can I declare a .txt file as a string?
<p>I have a text file whose Unicode characters I'd like to read one-by-one using <code>charCodeAt()</code>. Is there syntax I can use to declare the contents of the file as a string by specifying the URL of the text file?</p>

<p>EDIT: I have the following code using jQuery <a href="http://stackoverflow.com/questions/6682405/how-can-i-declare-a-txt-file-as-a-string/6682477#6682477">as recommended below</a>:</p>

<blockquote>
<pre><code>var t;
var music = function(source){
        $.get(source, function(data){
        t = data;
    });
}
music('music.txt');
alert(t.length);
</code></pre>
</blockquote>

<p>But the alert is presently <code>undefined</code>. What am I missing?</p>
