有一种朋友不在生活里,却在生命力;有一种陪伴不在身边,却在心间。图老师即在大家的生活中又在身边。这么贴心的服务你感受到了吗?话不多说下面就和大家分享用jquery ajax获取网站Alexa排名的代码吧。
【 tulaoshi.com - Web开发 】
 代码如下:
html 
head 
title/title 
script type="text/javascript" src="http://jqueryjs.googlecode.com/files/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 
来源:http://www.tulaoshi.com/n/20160219/1607327.html
看过《用jquery ajax获取网站Alexa排名的代码》的人还看了以下文章 更多>>