<b>Simple AJAX call to load an HTML document
</b>
<p>The video for this example demonstrates a few cross-domain scripting limitations. Don't assume you can access <b>any</b> URL using an AJAX request!</p>
<div id="putItHere"> </div>
JavaScript
var el = document.getElementById("putItHere");
// Create the XHR, intitalize the connection with open())
// and send the request ... https://www.quandl.com/resources/api-for-commodity-data
var xhr = new XMLHttpRequest();
// 1) Silver, Engelhard industrial bullion daily
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/WSJ/AG_EIB");
// Use this API call to get data in JSON format, using your selected parameters.
//xhr.open("GET", "https://www.quandl.com/api/v1/datasets/WSJ/AG_EIB.json?auth_token=dCkdMBF2jDN6_XfYnkZe&rows=1");
// 2) Silver, Engelhard fabricated products daily
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/WSJ/AG_EFP");
// 3) Silver, Handy & Harman base daily: Units: $ per troy oz. Source: via WSJ Market Data Center.
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/WSJ/AG_HHB");
// 4) Silver, Handy & Harman fabric daily: Units: $ per troy oz. Source: via WSJ Market Data Center.
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/WSJ/AG_HHF");
// 5) DEPRICATED! Silver Price: London Fixings. London Bullion Market Association (LBMA). Fixing levels are set per troy ounce
//["Date","USD","GBP","EUR"],"private":false,"type":null,"premium":false,"data":[["2015-04-15",16.18,10.974,15.2786]]}
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/OFDP/SILVER_5.json?auth_token=dCkdMBF2jDN6_XfYnkZe&rows=0");
// NO 6) Silver, Silver Coins, wholesale daily Cash commodity price for Silver Coins, wholesale. Units: $ per $1,000 face value.
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/WSJ/AG_CNF");
// NO 7) Silver, Shanghai Silver Futures daily Contract Size : 15 kilograms /lot
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/SHFE/AGV2013");
// NO 8) Silver, COMEX Silver Futures daily Non-adjusted price based on spot-month continuous contract calculations.
//xhr.open("GET", "http://www.quandl.com/api/v1/datasets/OFDP/FUTURE_SI1");
// NO 9) Silver, World Bank monthly
//xhr.open("GET",...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.