As the title says, jQuery's load doesn't work and I can't understand the cause or solution even if I look at the error code, so I would appreciate your help.
The files are in the same hierarchy, and it seems that specifying the path is fine.
Also, even if you write it in the head tag, only alert will work normally.
The error in the validator looks like this:
Access to XMLHttpRequest at'file:///Users/nr/common/header.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.
Failed to load resource: net::ERR_FAILED
The same applies to side and footer.
Answer # 1
This is limited for security reasons.
I already have a similar question and the answer is very detailed so please see the link below.
I want to load the common part of html with jQuery (https://stackoverflow.com/questions/280706)
- cannot convert jquery to an external file
- jquery - the navigation value of the slide cannot be obtained