I am trying to make a simple $.getJSON
request to the following URL:
http://dev.markitondemand.com/Api/v2/InteractiveChart/json?parameters=%7B%22Normalized%22%3Afalse%2C%22NumberOfDays%22%3A7%2C%22DataPeriod%22%3A%22Day%22%2C%22Elements%22%3A%5B%7B%22Symbol%22%3A%22NUS%22%2C%22Type%22%3A%22price%22%2C%22Params%22%3A%5B%22c%22%5D%7D%5D%7D
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:1337' is therefore not allowed access.
My code is pretty straightforward:
var ticker = "CRR";
var url = "http://dev.markitondemand.com/Api/v2/InteractiveChart/json?parameters=%7B%22Normalized%22%3Afalse%2C%22NumberOfDays%22%3A7%2C%22DataPeriod%22%3A%22Day%22%2C%22Elements%22%3A%5B%7B%22Symbol%22%3A%22" + ticker + "%22%2C%22Type%22%3A%22price%22%2C%22Params%22%3A%5B%22c%22%5D%7D%5D%7D";
$.getJSON(url, function(data) {
console.log(data);
}).success(function() {
$('#show-data').html("Successfully retrieved data.");
}).error(function() {
$('#show-data').html("Service Unavailable.");
});
It's not running any error or success functions, and I'm getting the same thing when I try $.ajax
instead. As far as my setup goes, I'm experimenting with a MEN project, so Mongo, Express, and Node.js on my localhost. Any help would be appreciated.