I am building a travel website where for the search destinations option I am getting the following error:
Origin null is not allowed by Access-Control-Allow-Origin
My json file is in my folder itself, the following is my jquery code:
$(document).ready(function() {
$.getJSON('resort.json', function(data) {
$("#searchresort").on("click", function() {
var userDept = $("input:checked").val();
var output = "<ul>";
for (var i in resort.resorts) {
if( (userDept == resort.resorts[i].destination) || (userDept == "Any") ) {
output+="<li>" + resort.resorts[i].picture + "<br> " + resort.resorts[i].name + "<br>" + resort.resorts[i].short_description + "<br> " +"<a href='" + resort.resorts[i].id + ".html'>Visit Page</a></li>";
// " -- " + data.users[i].dept+"<a href='" + data.users[i].id + ".html'>Visit Page</a></li>";
}
}
output+="</ul>";
document.getElementById("placeholder").innerHTML = output;
});
if anyone could help me out with this, it would be great.