title: Uncaught ReferenceError: loadNext is not defined (anonymous function)
body: <p>I am getting this error</p>
  
  <pre><code>Uncaught ReferenceError: loadNext is not defined
  (anonymous function)
  </code></pre>
  
  <p>The line that is causing this is</p>
  
  <pre><code>&lt;img name="imageLoad" class="hiddenPic" src="&lt;?php echo "albums/$folder/$startImage"; ?&gt;" onLoad="javascript:loadNext();" /&gt;
  </code></pre>
  
  <p>It refers to this function above the image tag.</p>
  
  <pre><code>function loadNext() {
      ///alert("maxphoto="+maxPhoto+"start="+start+"loadingindex"+loadingIndex);
      loadingIndex = nextPhotoToLoad(1, maxPhoto,start, loadingIndex);
      if (loadingIndex != '')
      {
          document.images['imageLoad'].src = img[loadingIndex-1];
      }
  }
  </code></pre>
  
  <p>The function is defined. Why am I getting a an error where it says it is not defined?</p>
  
  <p><strong>Edit</strong>: Here is the entire file. <a href="http://pastebin.com/gu1V5RMd" rel="nofollow">http://pastebin.com/gu1V5RMd</a></p>