I am working on a project that is based on this UCDavis Wayfinding Library. I have noticed that I am unable to successfully load my index.html page in my browser if I open it as a file.
Whenever I open it as a file with a URL something like:
file:///C:/Some/Folders/Here/index.html
I see this error in the js console:
XMLHttpRequest cannot load file:///C:/Some/Folders/Here/demo_map_2.svg. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
I understand what the error is telling me. And sure enough if I throw my project into Dropbox and access it via a public http link it works fine.
The part that I don't get though is why is it considered a Cross Origin request when the svg file is also stored locally, right alongside the html file?
Is there any way other than hosting the file under some sort of webserver (or similar service like dropbox) to get the .load() function to resolve successfully on a resource that is local to the same directory as the html file?