title: I keep getting a "Uncaught TypeError: string is not a function" error, even though my code seems to be fine. Can anyone have a look and explain?
body: <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;script language = javascript&gt;
      show = function()
      {
           document.getElementById("name").innerHTML = window.opener.game.pl.guild.n;
           var app = document.getElementById("app");
           var apps = window.opener.game.pl.guild.app;
  
           for (a in apps)
           {
                var appAdd = document.createElement("option");
                appAdd.text = apps[a];
                appAdd.value = apps[a];
  
                app.add(appAdd);
           }
      }
  
      accept = function()
      {
          console.log("Accepting");
          var app = document.getElementById("app");
  
          window.opener.input.options = "acceptApp";
          window.opener.input.an = app.options[app.selectedIndex].value;
      }
      &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body onload = "show()"&gt;
          &lt;h1 id = "name" align = "center"&gt; ### &lt;/h1&gt;
      &lt;div style="text-align:center"&gt;
              &lt;p&gt;You own this guild.&lt;/p&gt;
          &lt;/div&gt;
      &lt;/br&gt;
  
          &lt;p&gt;Applications:&lt;/p&gt;
          &lt;select id = "app"&gt;&lt;/select&gt;
  
          &lt;input type = "button" onclick = "accept()" value = "Accept application" /&gt;
       &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Every time a user clicks the button, the <strong>accept</strong> function should be called. There's nothing wrong with the function itself, I'm sure about that. The function <strong>show</strong> that gets called when this starts just fills the selection with options, and <strong>create</strong> just sends it to the server.</p>