How to access properties file using javascript

How to access properties file using javascript. Typically, a property file is an xml-based file. I open access to the properties file as follows:

Properties prop = new Properties();
            fis = getClass().getResourceAsStream("props.xml");

            if (fis != null) {
                prop.loadFromXML(fis);
            }
String dbUrl = prop.getProperty("dburl");

I want to do the same, but using javascript. is there any way to do this?

+3
source share
4 answers

JavaScript cannot upload files as part of its security model. It can retrieve XML from the server using AJAX, but it cannot read files from the client computer.

+2
source

You cannot download files from a user's computer using javascript in a browser.

, , ajax, XMLHttpRequest.

+2

Javascript , javascript, html, XMLHTTPRequest .

, , ​​ , , , .

, , , , .

Javascript java, , javascript , -, , .

Javascript , script, .

javascript, .

+1

Source: https://habr.com/ru/post/1718673/


All Articles