开发者

Using XML in HTML page without using a server

开发者 https://www.devze.com 2023-01-29 21:58 出处:网络
Is it possible to use XML in HTML pages and retrieve the information using javascript from the XML files?

Is it possible to use XML in HTML pages and retrieve the information using javascript from the XML files?

I'm asking it because I don't have a server and I'm using an HTA. I want 开发者_如何学Cthe XML to contain data and that it will be easy to modify and update if necesary.

I tried using xmlhttprequest and it's not working without a server of course..

I thought using this XML pages as the main page and only use CSS to design it, but it seems to be even uglier than just using a normal HTML page.

Thanks, Rotem


Javascript is run entirely via your web browser, so there is no need for a server side technology (such as php, Coldfusion, .NET, etc).

If you store a copy of jquery locally, and load it, you can do some pretty fancy XML manipulation: http://think2loud.com/reading-xml-with-jquery/

It sounds like you might be wanting to do an XSLT Transform (http://en.wikipedia.org/wiki/Xslt). This can also be done within a web browser without any server to run upon.


The only browser I know of that allows you to do so was IE with XML Data Islands, this was with IE 5 and worked with IE 6, though I don't know if later versions have this feature.

However, you can emulate these with the DOM - see this wiki page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号