jquery-function doesn't show anything
<p>I'm trying to create a random generator and on another page if found a hint, that this would be easy using jQuery, so I tried the following.</p>

<pre><code>&lt;html&gt;
 &lt;head&gt;
  &lt;title&gt;hello&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;script type="text/javascript"&gt;
   $ (document).ready(function() {
    $("body").load("hello.txt", function(msg) {
        var textArray = msg.split("\n");
    var zufall = Math.round ( ( textArray.length - 1 ) * ( Math.random() ) );
    });
   });
   document.write('&lt;p&gt;' + textArray[zufall] + '&lt;/p&gt;');
  &lt;/script&gt;
 &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>it should work like this:
it loads a document with serveral lines of text ans splits it up at line break. this should be stored in an array and a random line should be displayed on the website. </p>

<p>My first idea was to write the text directly into an array but i thougt loading it would be more efficient for the website.</p>

<p>Thanks for answering</p>

<p>PS: there isn't a error-message like "Error on this page" when the browser runs it.</p>

<p><strong>Final Edit</strong>:</p>

<p>Thanks for helping!!! 
Now it works.</p>

<p>Here's the solution:</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;hello&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&gt;&lt;/script&gt;
            &lt;script type="text/javascript"&gt;
            $ (document).ready(function() {
                 $.get("hello.txt", function(msg) {
                    var textArray = msg.split("\n");
            var zufall = Math.round ( ( textArray.length - 1 ) * ( Math.random() ) );

            $('body').append('&lt;p&gt;' + textArray[zufall] + '&lt;/p&gt;');
                });
            });
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
