Unexpected identifier for function call
<p>I have a simple onclick feature which calls a function but im getting an unexpected identifier but i don't see where the mistake is, it doesn't actually give me the error until i click the link which is confusing.</p>

<p>This is the script:</p>

<pre><code>function discard_item(id,name){
 alert('test');
 return false;
} 

function load(){
   name = 'test';
   id = 1;
   output = [];

   output.push('[&lt;a href="#" onclick="return discard_item("'+id+'","'+name+'")"&gt;Discard&lt;/a&gt;]');

   document.getElementById('main').innerHTML = (output.join(''));

}

load();
</code></pre>

<p>When i click the link to call discard_item i get : Unexpected token } </p>

<p>Can't seem to see a mistake in my script though ?   <a href="http://jsfiddle.net/Lu2HK/6/" rel="nofollow">http://jsfiddle.net/Lu2HK/6/</a></p>

<p>Hope you can help!</p>
