You can achieve your goal using the code below.
<!DOCTYPE html> <html> <head> <script> function saveBaseValue() { var xmlhttp; var XMLname="file:///C:/Users/setting.xml" if (window.XMLHttpRequest) { xmlhttp=new window.XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { alert(xmlhttp.responseXML); } }; xmlhttp.open("GET",XMLname,false); xmlhttp.send(); } } saveBaseValue(); </script> </head> <body> <h1>Test</h1> </body> </html>
But by default, your browser will not allow you to access this local file, as it concerns security, but if you still want to access it, then close all instances of chrome, get on the command line, change the directory to your chrome. exe is present and executed under the command.
.\chrome.exe --allow-file-access-from-files --disable-web-security
source share