开发者

getting data using javascript

how can I get this exchange rates from a web service using htm and javascript?

getting data using 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.


If you find an exchange rate webservice to call, you'll need to set up a proxy service in your own website to call it, and return that data via json to your page. Easist way to get that json data onto your page is probably to use jQuery.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜