0

我需要使用 jQuery 从客户端读取 Alexa 排名。网址是这样的:

http://data.alexa.com/data?cli=10&data=snbamz&url=http://www.facebook.com

返回的对象是 XML 格式的,所以我不能使用 JSON。有什么建议吗?

4

1 回答 1

1

The following link gives step by step instructions on how to read the data and display it.

http://think2loud.com/224-reading-xml-with-jquery/

You basically have to dig into each level, which will need to be made custom to your application and the data being pulled.

Addition

In order to pull the xml data from an external domain, first pull it into a separate page on your site using php. Once the data is in a local page you may do whatever you want with it.

$homepage = file_get_contents('http://data.alexa.com/data?cli=10&data=snbamz&url=http://www.facebook.com');
echo $homepage;
于 2012-02-08T17:35:55.347 回答