I didn’t test this method successfully. Can you help me find out what’s wrong?
w3c link
Under Chrome, using XMLHttpRequest to request the file protocol will be considered cross-domain. You can use Firefox to test, or set up a server
https://stackoverflow.com/que...
Ajax file request is definitely not possible. Put the project on the server and let the server return header.html.
You can use node to set up a server yourself, and then make requests
load(url,data,function(response,status,xhr))The url here should be an address that can return a string-like address. Did you understand it wrong? What does it mean to put header.html? Do you want to return the content of the html file?
Under Chrome, using XMLHttpRequest to request the file protocol will be considered cross-domain. You can use Firefox to test, or set up a server
https://stackoverflow.com/que...
Ajax file request is definitely not possible. Put the project on the server and let the server return header.html.
You can use node to set up a server yourself, and then make requests
load(url,data,function(response,status,xhr))
The url here should be an address that can return a string-like address.
Did you understand it wrong? What does it mean to put header.html? Do you want to return the content of the html file?