Defined function is not found
<p>I have this function which is called in a for loop.     </p>

<pre><code> function printResult(name, i) {

$('#list').append("&lt;a href='#' onClick='goto(" + i + ");' class='item'&gt;&lt;H1&gt;" + name + "&lt;/H1&gt;    &lt;/a&gt;");
 }
</code></pre>

<p>The a href-tags are appended as they should, but when I call the goto function firebug says: 'goto is not defined'</p>

<p>But it is!!</p>

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

<pre><code>function goto(myPoint){
      map.setCenter(new google.maps.LatLng(marker[myPoint-1].position.lat(), marker[myPoint-      
      1].position.lng()));
     markerArr[myPoint-1]['infowindow'].open(map, markerArr[myPoint-1]);
  }
</code></pre>

<p>I'm clueless as to why the function is not found. Does it have something to do with it being called in the appended  a href-tag?</p>
