title: HTML onload - using variables as parameters
body: <p>I want to use something like: </p>
  
  <pre><code>&lt;body onLoad="init('A sentence with "quoted text" as parameter')"&gt;
  </code></pre>
  
  <p>Unfortunately, this does work, as the quotes in the parameter are not treated properly.</p>
  
  <p>Escaping the quotes also does not work</p>
  
  <pre><code>&lt;body onLoad="init('A sentence with \"quoted text\" as parameter')"&gt;
  </code></pre>
  
  <p>(Above also does not work).</p>
  
  <p>How do I deal with this. I though maybe I can create a string variable and assigne my sentence (with quotes) to it.  But I dont know how to do it! The body onload is HTML and the Javascript variables would be visible only within the scope of the script, right? To be precise, the following does not work:</p>
  
  <pre><code>&lt;script language="JavaScript"&gt;
  var dada='A sentence with \"quoted text\" as parameter';
  &lt;/script&gt;
  &lt;body onLoad="init($dada, '&lt;/a&gt;')"&gt;
  </code></pre>