How can I include more than one Javascript file?
<p>I want to use more Javascript files on one canvas, but I can't connect them. For example I want to write a Javascript file that contains all functions and an other Javascript file which is using them.</p>

<p>Show me a guide, how can I make this connection?</p>

<p>Thanks.</p>

<p>This is the first javascript file :</p>

<pre><code>var canvas = null;
var ctx = null;

window.onload = function () {
    canvas = document.getElementById('myCanvas');
    ctx = canvas.getContext('2d');

    line (100,100,300,300);
}
</code></pre>

<p>This is the secnond file:</p>

<pre><code>function line (x1,y1,x2,y2) {
    ctx.beginPath();
    ctx.moveTo(x1,y1);
    ctx.lineTo(x2,y2);
    ctx.stroke();
}
</code></pre>

<p>And this is my html file:</p>

<pre><code>&lt;!DOCTYPE html&gt;

&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Tutorialok&lt;/title&gt;
    &lt;script type="text/javascript" src="CanvasElement.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="line.js"&gt;&lt;/script&gt;
    &lt;style&gt;
        #myCanvas {
            border: 1px solid #9C9898;
        }
    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;canvas id="myCanvas" width="800" height="600"&gt;
        Sorry your browser Does not support canvas element!
    &lt;/canvas&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The first file cant find the second files function.</p>
