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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.