javascript not generating in browser, just prints code to screen
<p>First off, I am not asking anyone to do my homework. The point of this was to write a simple webpage to become familiar with javascript. It generates and displays random cards from a folder called 'cards'. I completed that part. However, when I submitted it to the teacher he sent me back this screenshot with the subject line "any ideas?" </p>

<p><a href="http://i38.tinypic.com/2wr3e2p.jpg" rel="nofollow">http://i38.tinypic.com/2wr3e2p.jpg</a></p>

<p>I have tested this page on several machines and it works in every browser. I have no idea why it just prints the code to the page when he runs it. Any thoughts? (I'm assuming he would javascript enabled, especially since everyone in my class is submitting this program).</p>

<p>Edit:  here's the code, sorry but I included everything just to clear any questions</p>

<pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Aaron's Gamble Page!&lt;/title&gt;

&lt;style type="text/css"&gt;
* { padding: 0; margin: 0; }

body 
{
 font-family: Arial, Helvetica, sans-serif;
 font-size: 13px;
 background: #48454C;
}
#wrapper 
{ 
 margin: 0 auto;
 width: 365px;
}
#header 
{
 color: #333;
 width: 365px;
 padding: 10px;
 margin: 10px 0px 0px 0px;
 background: #A29EA2;
}
#centercolumn 
{
 color: #333;
 padding: 10px;
 width: 365px;
 background: #DFE0DB;
}
#footer 
{ 
 width: 365px;
 clear: both;
 color: #333;
 background: #A29EA2;
 padding: 10px;
}
&lt;/style&gt;

&lt;script type="text/javascript" charset="utf-8"&gt;
// this page created by Aaron Albin
// creation date: October 17, 2009

var score = 0;

function generateCards()
{
    var i, randType, randSuite;
    var type = new Array("2", "3","4","5","6","7","8","9","t","j","q","k","a");
    var suite = new Array("c","d","s", "h");
    var cards = new Array(5);
    for (i = 0; i &lt; cards.length; i++)
    {
        cards[i] = setRandomCard(type, suite, cards);
        document.write('&lt;img src = "'+cards[i]+'"&gt;');
    }
}

function setRandomCard(type, suite, cards)
{
    var randType, randSuite;
    var filePath = "file://C:/cards/";
    var fileExt = ".gif";

    do
    {
        randType = Math.floor(Math.random() * type.length);
        randSuite = Math.floor(Math.random() * suite.length);
    }
    while(checkDuplicate(randType, randSuite, filePath, fileExt, type, suite, cards));

    addScore(type, randType);
    return filePath + type[randType] + suite[randSuite] + fileExt;
}

function checkDuplicate(randType, randSuite, filePath, fileExt, type, suite, cards)
{
    var j;
    for (j = 0; j &lt; cards.length; j++)
    {
        if (cards[j] == filePath + type[randType] + suite[randSuite] + fileExt)
        {
            return true;
        }
    }
    return false;
}

function addScore(type, randType)
{
    switch(type[randType])
    {
        case "2":
            score += 2;
            break;
        case "3":
            score += 3;
            break;
        case "4":
            score += 4;
            break;
        case "5":
            score += 5;
            break;
        case "6":
            score += 6;
            break;
        case "7":
            score += 7;
            break;
        case "8":
            score += 8;
            break;
        case "9":
            score += 9;
            break;
        case "t":
            score += 10;
            break;
        case "j":
            score += 11;
            break;
        case "q":
            score += 12;
            break;
        case "k":
            score += 13;
            break;
        case "a":
            score += 1;
            break;
        default:
            score += 0;
    }
}
&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;
   &lt;div id="wrapper"&gt;
         &lt;div id="header"&gt;&lt;/div&gt;
            &lt;div id="centercolumn"&gt;
                &lt;h2&gt;Gamble!&lt;/h2&gt;     
                &lt;br /&gt;
                &lt;p&gt;Welcome to my gambling page.  You have drawn&lt;/p&gt;&lt;br /&gt;
                &lt;script type="text/javascript" charset="utf-8"&gt;generateCards();&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;
                &lt;p&gt;The value of this hand is &lt;script type="text/javascript" charset="utf-8"&gt;document.write(score);&lt;/script&gt;.&lt;/p&gt;
                &lt;br /&gt;
            &lt;/div&gt;
         &lt;div id="footer"&gt;&lt;/div&gt;
   &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
