title: PHP, jQuery Ajax and json return over a cross domain
body: <p>I have my php coded page on one server that returns a json result.
    php file called: getInfoData.php and the return is as below.</p>
  
  <pre><code>  echo json_encode($v);
  </code></pre>
  
  <p>No I can use $.getJSON(??) to read the json and run it all on the same sever fine, but I need the php page to be on a different sever than the js page calling it.</p>
  
  <p>But then I get then when I do I get the cross domain issue.</p>
  
  <p>So I changed the code to use the following (jsonp):</p>
  
  <pre><code>  $.ajax({
      url: 'FILE_LOCATION_ON_ANOTHER_SERVER',
      type: 'GET',
      crossDomain: true,
      dataType: 'jsonp',
      success: function() { console.log("Success"); },
      error: function() {console.log('Failed!'); }
  });
  </code></pre>
  
  <p>but I do not see anything I just get the following with my console:</p>
  
  <pre><code>  http://www.THEURL.com/FOLDER/FILENAME.php?callback=jQuery171013088115444406867_1332256223342&amp;_=1332256223343
  </code></pre>
  
  <p>and a message saying failed!.</p>
  
  <p>What am I doing wrong and how if at all can I fix this?</p>
  
  <p>Thanks</p>