At the moment, due to the chromium security policy , it is not possible to load local files via ajax without the “--allow-file-access-from-files” argument. But I currently need to create a web application where the database is an xml file (at least json), located next to index.html. It is understood that the user can run this application locally. Are there any workarounds for cross-browser (ie11 +) reading the xml- (json-) file, without wrapping it into a function and renaming it to js format?
UPD
There is code for IE, but with it, as it turned out, there were no problems and there was no
function loadXMLFile(filename) { return new Promise(function(resolve, reject) { // Если мы имеем дело с IE, то работает с ActiveX-контентом if('ActiveXObject' in window) { // Получение xml-текста из файла для осла var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); xmlDoc.async = false; xmlDoc.load(filename); resolve(xmlDoc.xml); } else { // Если мы работаем с нормальными браузерами, // то здесь необходимо как-то получить xml-файл // ... // } } }