Click here to Skip to main content
15,896,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

I just need to catch the response here using a JSON wrapper and view in JSON document properly, once the i click the button. (as you know there is JSON editor we could use to get this work done but involves copying/pasting in that, i don’t want that)


Here is the part of code -->>

<!DOCTYPE html>
<html>
<title > API Integration Test Show active Droplets </title>
<head>

</head>
<body>

API integration test 1 - show active Droplets




<input type="button" value="Show Active Droplets"
önclick="window.open('https://api.digitalocean.com/[API_resource]/?client_id=[YOUR_CLIENT_ID]&api_key=[YOUR_API_KEY]&[request_info]')">


</body>


</html>


code finishes --




Regds

Kashif
Posted

1 solution

I love the JSON API, but without a proxy, I'm unable to make API calls via cross-domain Javascript. This is easily fixed with the addition of an optional callback parameter to wrap the JSON response. A call to /someMethod?api_key=…&callback=myCallback would return:

myCallback({"response": … })
What say you?

Further more details you can visit this link[^]. It might be helpful to you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900