title: Uncaught Reference Error: function is not defined
body: <p>I'm working on an app for webOS that will take a megaupload link(assuming its a video), parse it into a direct link and stream it to a ffplay port for webos called TouchPlay.
  I'm working on a basic prototype that will just take the end code on a megaupload link and return a direct link.
  Now that I have laid out the basic parts of my application, on to my question.  I want to take data in a form in an html page and feed it into a function in an external js script.
  Here's the html portion</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script LANGUAGE="JavaScript" src="source/main.js"&gt;&lt;/script&gt; 
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form NAME="myform" ACTION="" METHOD="GET"&gt;
              Enter the MegaUpload Code, ex. megaupload.com/?d=glgrn8f1 -&gt; glgrn8f1: &lt;BR&gt;
              &lt;INPUT TYPE="text" NAME="inputbox" VALUE=""&gt;
              &lt;INPUT TYPE="button" NAME="button" Value="Click" onClick="javascript:codeIn(this.form);"&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And in my main.js file is in a subdirectory called source and it contains <code>function codeIn(code){</code> plus the rest of the functions.</p>
  
  <p>Yet when I enter some test data in my web page and hit submit, I get an error in the chrome dev console saying <code>Uncaught Reference Error: codeIn is not defined</code></p>
  
  <p>I have a very limited experience with html and javascript, but I cant seem to figure this out, I imagine its something really simple that I'm missing.</p>
  
  <p>EDIT:  Here's main.js, and yes, I have checked for typos. Just ask if you need to see the contents of any of these functions, but I didn't think they were neccesary.</p>
  
  <pre><code>function codeIn(code){
      ...
  }
  
  function getInfo(url){
      ...
  }
  
  function waiting(timer){
  ...
  
  }
  </code></pre>
  
  <p>Ive looked through all these suggestions and it all seems to point to a syntax error, yet when I try to put all the js functions into the head of the html, it works.  So thats what I'm doing.  I don't change a single thing when I reference it from source/main.js, but whatever.</p>