Jump to content

JSON remote call


sohaibshaheen

Recommended Posts

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>

 

 

Link to comment
https://forums.phpfreaks.com/topic/213559-json-remote-call/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.