I am trying to access JSON data from separate json file(in different folder)but it is throwing exception " No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. "
I have my file at root "Index.html".Parallel to this there is a separate folder "JSON" which contains my json file "quotes.json". My Code is
$(document).on("pagebeforeshow", "#info-page", function () {
$.getJSON("Json/quotes.json", function (data) {
var items = [];
$.each(data, function (key, val) {
items.push(val);
alert(data.key);
});
});
});