title: How to read and parse json file from html tag
body: <p>I have some html file with a script tag of type `application/json', i am trying to read that json on my javascript code which is on separate file and loaded to that html. But i can only find jQuery examples, and i want to do it in pure javascript.</p>
  
  <p>Here is an example on jquery:</p>
  
  <pre><code>&lt;script id="myJson" type="application/json"&gt;
   { 
     name: 'Foo' 
   }
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      $(function() {
          var x = JSON.parse($('#myJson').html());
          alert(x.name); //Foo
       });
  &lt;/script&gt;
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code>&lt;script src="Game.js"&gt;&lt;/script&gt;
  &lt;script type="application/json" id="data"&gt;
  {'name':'foo'}
  &lt;/script&gt;
  </code></pre>
  
  <p>Javascript code:</p>
  
  <pre><code>var json_file = JSON.parse(document.getElementById('data'));
  </code></pre>