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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -