将XML文件从本地计算机加载到网页中 [英] Loading an XML file from local computer into a web page

查看:95
本文介绍了将XML文件从本地计算机加载到网页中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定我是否在这个问题的正确论坛上。


我正在开发一个无服务器的网页,它将加载一个XML文件,这样我就可以重新格式化数据和把它放回电脑上。


我使用的是FireFox 8.0。


使用new FileReader();将文件读入网页没有问题。


我试过这两个格式:

Not sure if I am in the right forum for this question.

I am developing a server-less web page that will load an XML file so I can reformat the data and put it back on the computer.

I use FireFox 8.0.

I have no problem reading the file into the web page with "new FileReader();"

I tried both of these formats:

展开 | 选择 | Wrap | 行号

推荐答案


虽然我有没有弄清楚如何使用DOMString编码选项也不知道我是否需要它。
Although I have not figured out how to to use DOMString encoding option nor do I know if I need it.



如果你用UTF-8编码你不需要它(默认编码),否则

if you encoded it in UTF-8 you don’t need it (default encoding), otherwise

展开 | 选择 | Wrap | 行号


好的,这样就无法帮助我获得xml文档。我还能做些什么来将xml格式的数据呈现给网页的javaScript?
Ok so that is not going to help me get a xml doc. What else can I do to present the data in an xml format to the web page''s javaScript?


没有查看myFileReader.zip,但是它有一个输出方法(可以与PHP的 file_get_contents()或像 .toString()这样简单的东西比较吗?
didn’t look into myFileReader.zip, but does it have an output method (compareable to PHP’s file_get_contents() or something simple like .toString())?


这篇关于将XML文件从本地计算机加载到网页中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆