title: JQuery Json Access of a Sharepoint List via Rest
body: <p>I try to access a sharepoint list via Jquery and REST Interface. The Site with the code below is running localhost.</p>
  
  <p>This code doesn't work:</p>
  
  <pre><code>$(document).ready(function() { getdata(); });
  
  function getdata() {
  
      alert("start");
  
      $.ajax({
          url: "http://spkerberostest.vz.ch/_vti_bin/ListData.svc/Tasks",
          dataType: 'JSON',
          success:function(json) { alert ("Success");
          },
          error:function(){
              alert("Error");
          }
      });        
  };
  </code></pre>
  
  <p>I get the Error Message
  "Origin <a href="http://localhost:59936">http://localhost:59936</a> is not allowed by Acess-Control-Allow-Origin."</p>
  
  <p>I'm not sure what the reason is. Is it the fact that Sharepoint needs Authentication (anonymous is blocked) or is it the cross-domain call? Or even both?</p>
  
  <p>What can I do? I read somewhere about JSONP as Data Type. But this didn't work.
  Thanks.</p>