Click here to Skip to main content
14,639,459 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100