I am trying to use the query load() method to load in html from other files into a div.
$(document).ready(function(){
$("#president").click(function(){
event.preventDefault();
$('#content').load('president.html')
});
});
Here, I want to load president.html into my content div when a button is pressed. The content div looks like this:
<div class="col-md-7" id = "content">
</div>
When I try to click the button, I get this error in the console:
Access to XMLHttpRequest at 'file:///UsersKunal/testing/president.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Both files are in the same folder.