I’ve been hammering on getting fonts to load properly in HTML5 but can’t seem to get my head around it. The error I’m getting when loading in Chrome is:
XMLHttpRequest cannot load file:///C:/Users/Luke/Desktop/Github/ColourID/bin/html5/bin/font/OpenSans-Italic.eot.
Cross origin requests are only supported for protocol schemes: http, data, chrome,
chrome-extension, https, chrome-extension-resource.
What’s strange about this error is that it’s not a cross-origin request, because both the web page and file request are hosted on the same domain, that being my local computer. Microsoft Edge, while it does not report the above error, also seems to be stuck on the loading screen as if the same error is occurring.
Despite, this I tried to toy around with
HTTPRequest file to load a file using the now standard File API for html5, but couldn’t get it to function properly. I’ve lost the code before returning back to the original file state, so I can’t share it if you were curious what the code was (sorry!)
If I remove text entirely and all the font files, the application runs fine.
I can’t get my head around the stupidity of HTML5, so I’m hoping someone with a lot of knowledge of it can help me here. Thanks in advance.