使用JavaScript获取数据 [英] getting data using javascript
问题描述
我怎么能使用HTM和JavaScript得到这个汇率从Web服务?
字典Türkiye的土耳其= | DUNYA =世界|儿子güncellenme=最后更新日期
块引用>解决方案欧洲银行提供了对欧元交易中最常见的货币免费的每日汇率的URL。格式为XML。
http://www.ecb.europa.eu/stats/ eurofxref / eurofxref-daily.xml
您必须让你的服务器上的网页,将调用XML解析之上,并返回值。
有就是在这样页面的一个PHP的例子:
http://www.ecb.int/stats/exchange/eurofxref /html/index.en.html
这个例子的输出是文本,但我想发送 JSON ,而不是会更容易在浏览器的JavaScript来处理。how can I get this exchange rates from a web service using htm and javascript?
Dictionary Türkiye = Turkey | Dünya = World | Son güncellenme = Last updating date
解决方案The european bank delivers a free daily exchange rates url for the most common currencies traded against the EURO. The format is XML.
http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
You have to make a page on your server that will call the xml above parse it and return the values.
There is a PHP example of such page at: http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html
The output of the example is text, but I guess sending a JSON instead would be easier to handle with javascript on the browser.这篇关于使用JavaScript获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!