欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

用jquery ajax獲取網(wǎng)站Alexa排名的代碼

 更新時(shí)間:2009年12月12日 01:40:19   作者:  
其實(shí)就是利用了jquery的ajax功能,獲取遠(yuǎn)程的xml文件,讀取指定內(nèi)容的代碼,對于學(xué)習(xí)jquery的朋友是個(gè)不錯(cuò)的參考。

復(fù)制代碼 代碼如下:

<html>
<head>
<title></title>
<script type="text/javascript" src="http://img.jb51.net/jslib/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(function(){
$("#siteName").blur(function(){
$.ajax({
type: "GET",
url: "http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url="+$("#siteName").val(),
dataType: "xml",
success: function(xml)
{
$("#count").text($(xml).find("ALEXA SD POPULARITY").attr("TEXT"));
}
})
});
});
</script>
</head>
<body>
<input type="text" id="siteName" />
<span id="count"></span>
</body>
</html>

相關(guān)文章

最新評論