php - Display JSON data from external API -
i'm trying sort out knowledge jsonp. dont know how make callback external api
class myclass { private $_id = $_post['id']; public get_name() { $id = $this->_id; $request = 'http://external.sever.com/api.php?operation=get_name&id='.$id.'&callback=?'; } }
let's assume, api works properly, , callback like: {name:'kamil'} or this.
and comes javascript code
$.ajax({ url: get_request_from_myclass, datatype: 'jsonp' }).done(function(data) {send_data_as_$_post_or_another_php_var});
how put php variable in javascript , output $.ajax send server post variable?
Comments
Post a Comment