title: How to pass JSONObject to JavaScript function during on change event in HTML
body: <p>I am populating a JSONObject from backend Java and setting it to variable in JSP.</p>
  
  <p>I need to pass the variable to JavaScript function during <code>onchange</code> event.</p>
  
  <p>I am getting syntax error during <code>onchange</code> due to quotes present in the JSONObject.</p>
  
  <p>If I populate as a Map in backend java and I can able to set it to a variable in JSP and pass to JavaScript function successfully.</p>
  
  <p>My question?</p>
  
  <ol>
  <li>Shall we pass the JSONObject in onchange event as mentioned above. If yes what could be the syntax.</li>
  </ol>
  
  <p>I used <code>onchange="getCountries('${countryJSON}')"</code> which is not working.</p>
  
  <ol start="2">
  <li><p>If we escape the quotes in JSONObject, is it possible to parse the JSONObject in JavaScript function.</p></li>
  <li><p>Any alternative approach for this issue.</p></li>
  </ol>