JOAOSANTACRUZ.COM

Cross-Domain Ajax call - jQuery

Remote ajax call from a local cient using jQuery getJSON function


						

//Remote Server ajaxCall.php

<?php

$results = array("key" => "value");

echo $_GET[`callback`] . `(` . json_encode($results) . `)`;

?>

 

//Local Client index.html

jQuery.getJSON("http://myserver.com/ajaxCall.php?opt=1&callback=?", function(data) { alert(data.key); });

Go Back