title: Populate an iframe with json data
body: <p>I have a requirement of populating an iframe (HTML component) with a json data. I have a java script  function which on page load loads the json data. But, the iframe component is not able to load the data. </p>
  
  <p>My code implementation is:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;script src="http://code.jquery.com/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
  &lt;script
  src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt;
  &lt;script src="jquery.loadJSON.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  function populateData()
  {
  window.document.getElementById('one').style.color='red';
  var data = {"d1":"http://www.w3schools.com/"};
  $('form').loadJSON(data);            
  alert('start');
  }
  
  window.onload = populateData;
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
      &lt;label id="one" for="Address"&gt;Address:&lt;/label&gt;
  
      &lt;iframe id="d1" width="100%" height="50%" src="about:blank"&gt;
          &lt;p&gt;Your browser does not support iframes.&lt;/p&gt;
      &lt;/iframe&gt;
      &lt;br&gt; &lt;br&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>