At http://nwgerh.site88.net/default.php, the code is:
<html>
<body>
<?php
$url = "http://www.google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
echo json_encode($data);
?>
</body>
</html>
I’m trying to use Javascript to access the JSON from PHP. See my JSFiddle (based on this tutorial), but there are errors.
What’s wrong? Is there a cross-domain issue?
please post what error you’re getting..
But your fiddle had an error anyway:
It was missing the trailing
)it should work if it’s on the same domain