sohaibshaheen Posted September 16, 2010 Share Posted September 16, 2010 Hey! I am back with a new question... I want to create my own api which returns JSON data to the user when he opens a page: http://musicclan.com/json.php?format=json When I place this "json.php" file on my localhost and create "json_parser.php" to handle output it works fine but when I place that "json.php" at remote location like one above and try to access it on my localhost it doesnot respond. Note: I can access flickr and facebook APIs on my localhost. ... and JSON is also valid as I tested on some site. JSON_PARSER.PHP <head> <script src="jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> function loadFlickr() { $.getJSON('http://musicclan.com/json.php?format=json', function(data) { $("#feed").append(data.posts.post.foo+"<br/>"); }); } </script> </head> <body> <script type="text/javascript"> loadFlickr(); </script> <div id="feed"></div> </body> Quote Link to comment https://forums.phpfreaks.com/topic/213559-json-remote-call/ Share on other sites More sharing options...
RichardRotterdam Posted September 17, 2010 Share Posted September 17, 2010 I suggest you readup on jsonp. That's pretty much how flickr and facebook does it. Quote Link to comment https://forums.phpfreaks.com/topic/213559-json-remote-call/#findComment-1112005 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.