关于从xml检索数据并将其显示在html页面中 [英] about retrieving data from xml and display it in the html page

查看:60
本文介绍了关于从xml检索数据并将其显示在html页面中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是Ajax,xml和javascript的新手。

我想知道如何从xml中检索数据并显示在HTML页面?

请帮帮我。


假设我的xml文件是customer.xml,代码如下:

Hi guys,

I am new to Ajax, xml and javascript.
I want to know how can I retrieve data from xml and display in the html page?
please help me out.

suppose my xml file is customer.xml the code is below:

展开 | 选择 | Wrap | 行号

推荐答案

欢迎使用字节!


参见此示例。您也可以在不使用Ajax的情况下加载XML文件,例如请参阅此链接。如果您不理解某些内容或者无法根据自己的需求进行调整,请回来询问。


PS。发布代码时请使用代码标签。谢谢!
Welcome to Bytes!

See this example. You can also load an XML file without using Ajax, e.g. see this link. If you don''t understand something or you can''t adapt it to your needs, come back and ask.

PS. please use code tags when posting code. Thanks!


[quote = acoder]欢迎来到Bytes!


您好,

感谢您的回复。

我在wschools.com/中看到了示例。

请你把代码寄给我。总的来说我是javascript和Ajax的新手.......

希望你能帮帮我。


谢谢
[quote=acoder]Welcome to Bytes!

Hi,
Thanks for your reply.
I saw the example in wschools.com/
In the example they are retrieving the records from the xml file. But here I have only one record.How can I do that?????
Please could you send me the code. Totally I am new to javascript and Ajax.......
Hope you will help me out.

Thanks


无论您有一条记录还是多条记录,代码都是相同或相似的。展示你曾经尝试过的东西。
Whether you have one record or many records, the code would be the same or similar. Show what you''ve tried.


这篇关于关于从xml检索数据并将其显示在html页面中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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