I am using monaca IDE + phonegap to build a phone app.
I have created a restful server - http://engridmedia.com/next/api/channel/user/id/1
And i am trying to consume the json rest service with this jquery script in my js file.
$(document).ready(function() {
$.ajax({
url: "http://engridmedia.com/next/api/channel/user/id/1"
}).then(function(data) {
$('.ch-name').append(data.ch_name);
$('.ch_logo').append(data.ch_logo);
});
});
and calling it it in the body like this
<div>
<p class="ch_logo"> </p>
<p class="ch_name"> </p>
</div>
should this not be working? I have included the jquery.min.js file and the ajax file to the page . but it just wont show a thing.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…