So here's the link to the original w3school article about HTML include using their .js file link.
I literally copied everything from the w3school example, but got this error :
w3school.js:131 XMLHttpRequest cannot load file:///C:/Users/KBS-3/Desktop/project_1/html/header.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
As the error suggests, you are trying to include a local html file
Solution: Move your website to
localhost i.e. use
XAMP or a real server and you'll be fine.