I am trying to import external HTML-code into a document with jQuery but it doesn't seem to work. There is no occurence of the paragraph "I'm some text" and i need help figuring out why.
I am using the .load function as following:
$('#yourDiv').load('header.html #readMe');
The reference to the imported element looks like this:
<div id="yourDiv"></div>
The external HTML-file (header.html) looks like this:
<div><div id="readMe"><p>I'm some text</p></div></div>
The document with the query is located in the same directory as "header.html". I've tried changing the path with "/header.html" & "./header.html" but with no success.
This is what I see when I open up by browser console:
"Access to XMLHttpRequest at 'file:///C:/Users/correctpath' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https, isolated-app."