如何在浏览器中解析本地XML文件?
我们有一个可以搜索的网站。我们想将此网站制作成 CD,并保留搜索功能。因为我们希望它能够离线运行,所以我们无法使用数据库,所以我们认为我们使用 XML 文件作为“存储”。
现在的问题是我们无法使用javascript读取本地xml文件,因为某些浏览器认为这是一个安全问题。
如何读取和使用我们的离线网站的本地 XML 文件?我们可以使用什么技术来实现这一目标?
We have a website that has the option to search. We want to put this website on a CD and we want to preserve the search functionality. Because we want it to function offline also we can't use a database sow e thought we use an XML file as "storage".
Now the problem is that we can't read the local xml file using javascript because some browsers consider this a security problem.
How to read and use a local XML file for our offline website? What technology can we use to achieve that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

嗯,您始终可以嵌入签名的 Java 小程序。这将为您提供完整的文件系统访问权限。 Java 小程序可以读取并解析 XML 文件,并将数据发送到页面上的 JavaScript 函数。
Well, you could always embed a signed java applet. This will give you full filesystem access. The java applet can read and parse the XML file and send the data to a JavaScript function on your page.