Just another WordPress.com site

get some Json Data through a remote API

$(document).ready(function(){
$.ajax({
type: “GET”,
url: ‘http://ecarobar.com/xyz/api.php’,
data: { method: “get”, name: “jab”, format: “json” },
async: false,
dataType: “json”,
beforeSend: function(x) {alert(‘Not Yet Sent’)},
success: function(data){
alert (“AjAx Call”+data.responseBody.id+” “+data.responseBody.views); //further debug
$(‘#showdata’).html(“<p>item1=”+data.responseBody.id+” item2=”+data.responseBody.views+” </p>”);
}
});

$.getJSON(
http://ecarobar.com/xyz/api.php&#8221;,
{method: “get”, name: “jab”, format: “json” },
function(data) {
//alert(“JSON Data: ” + json.users[3].name);
alert (“JSON Call”+data.responseBody.id+” “+data.responseBody.views); //further debug
$(‘#showdata’).html(“<p>item1=”+data.responseBody.id+” item2=”+data.responseBody.views+” </p>”);
});
});

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: