title: Jquery Get json from remote host
body: <p>Hi i am trying to read json from a remote host by using this piece of code.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="jquery.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $(document).ready(function(){
  $("button").click(function(){
  $.getJSON("http://xx.xxx.xxx.xx/rest/user.json",function(result){
    $.each(result, function(i, field){
      $("div").append(field + " ");
        });
      });
    });
  });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;button&gt;Get JSON data&lt;/button&gt;
  &lt;div&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The problem is when i type the url in browser  i get json from it. But failed to get json by using the above jquery method.</p>
  
  <p>Can someone help in this regard. Thanks</p>