title: Passing a javascript variable into an inline html onclick function
body: <p>Im trying to pass a variable into an inline onclick function but without success. i've tried searching and i followed this but with errors(Uncaught SyntaxError: missing ) after argument list) : 
  <a href="https://stackoverflow.com/questions/9643311/pass-string-parameter-in-an-onclick-function">pass string parameter in an onclick function</a></p>
  
  <pre><code>google.maps.event.addListener(marker, "click", function(e) {
  infoWindow.setContent(data.name+ "&lt;br&gt; '&lt;input type="button"onClick="Myfunction(\'' + data.name + '\')" /&gt;');
  infoWindow.open(map, marker);
  });
  </code></pre>
  
  <p>I want to pass data.name results inside My function(data.name);</p>
  
  <p>Another thing that i want to process this result inside myfunction to load an image from Mysql php database shall i use Ajax? </p>