im getting "function not defined" in firebug. help please
<p>I am using an external javascript file to call a function and it will not. i get function not defined in firebug too.
the name of the external js file is getpic.js
in the html, i put this in the header:</p>

<pre><code>&lt;script src="getpic.js"  type="text/javascript"&gt;
&lt;/script&gt;
</code></pre>

<p>php:</p>

<pre><code>echo "&lt;button id='sldkfj' onclick='hg();'&gt;sdlkfj&lt;/button&gt;";
</code></pre>

<p>js:</p>

<pre><code>function hg()
{
alert("hello")

}
</code></pre>

<p>the file system is basically in one folder for wamp
this is all of getpic.js</p>

<pre><code>function hg()
{
alert("hello")

}
</code></pre>

<p>for the php part</p>

<pre><code>&lt;html&gt;
&lt;head&gt;

&lt;script src="getpic.js"  type="text/javascript"&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt; 

   &lt;?php
echo "&lt;button id='sldkfj' onclick='hg();'&gt;sdlkfj&lt;/button&gt;";

?&gt;
</code></pre>

<p>EDIT-----
i also keep getting this in firebug:  </p>

<pre><code>Reload the page to get source for: http://localhost/iframe/getpic.js
</code></pre>

<p>Thanks</p>
