title: Passing string with space character as parameter to on-click function generated by javascript
body: <p>My hypertlink  generated by JavaScript is as follows:</p>
  
  <blockquote>
  <pre><code>'&lt;a href="#" onClick=passSearchTerm("' +aa + '");&gt;View&lt;/a&gt;' 
  </code></pre>
  </blockquote>
  
  <p>The parameter passes wells when the string  is as follows:</p>
  
  <blockquote>
  <pre><code>var aa = 'TAGS(\\"ab\\")'; 
  </code></pre>
  </blockquote>
  
  <p>I confirmed it by alerting inside the function</p>
  
  <blockquote>
    <p>function passSearchTerm(aa)
          { 
               alert(aa);
           }</p>
  </blockquote>
  
  <p>However, this wont alert when the var is defined as follows:</p>
  
  <blockquote>
    <p>var aa = 'TAGS(\"a b\")';  //space between "a" and "b"</p>
  </blockquote>
  
  <p>Can anyone suggest me how to pass such string? Thanks in advance for your help.
  Actually I am trying to pass likely following string:</p>
  
  <blockquote>
    <p>TAGS("a or b")</p>
  </blockquote>