title: How can I read a JSON in the script-tag from JavaScript?
body: <p>I have a dynamically generated page where I want to use a static JavaScript and pass it a JSON string as a parameter. I have seen this approach used by Google (see <a href="https://stackoverflow.com/questions/6713197/googles-1-button-how-do-they-do-it">Google's +1 Button: How do they do it?</a>).</p>
  
  <p>But how should I read the JSON string from the JavaScript?</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script src="jquery-1.6.2.min.js"&gt;&lt;/script&gt;
      &lt;script src="myscript.js"&gt;{"org": 10, "items":["one","two"]}&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      Hello
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In this JavaScript I would like to use the JSON argument <code>{"org": 10, "items":["one","two"]}</code> from the HTML document. I don't know if it's best to do it with jQuery or without.</p>
  
  <pre><code>$(function() {
      // read JSON
  
      alert("the json is:")
  })
  </code></pre>