Hello there Iam trying to use the http://paste.kde.org api in order to make it work
My code seems like
var p = {};
p.id=122083;
p.mode='json';
$.ajax({
url: 'http://paste.kde.org/show.php',
data: p,
success: function(data) {
alert(data.result.id);
}
});
The output json is like :
{ "result": { "id": "122083", "author": "Anonymous", "timestamp": "1316135671", "language": "text", "data": "testing the app" } }
But I can;t make it work, also i have no alerts in the creation of the “pastes” although i can see them created in the paste.kde.org archive
I don’t believe that paste.kde allows for ajax requests to their api. When attempting to run your code from jsfiddle, I got the following error:
paste.kde.org would need to change their response headers to send the
Access-Control-Allow-Originheader so that your ajax request could complete.You could change your request so that your
$.ajaxcall goes to your local server (let’s say it’s using PHP), and then you could run acurlrequest to the kde API, and then have your PHP script parrot back the results from paste.kde.org.