用jquery ajax获取网站Alexa排名的代码
作者:bea
代码如下: <html> <head> <title></title> <script type="text/javascript" src="http://img./jslib/jquery/jquery-1.3.2.min.js"></script> <script type="text/javascript"> $(function(){ $("#siteName").b
代码如下:
<html>
<head>
<title></title>
<script type="text/javascript" src="http://img./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>
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- JQuery Tips(2) 关于$()包装集你不知道的
- 最简单的javascript对象实例代码
- 读取table内容的javascript代码
- js 页面传参数时 参数值含特殊字符的问题
- input 日期选择功能的javascript代码
- JQuery下关于$.Ready()的分析
- javascript下搜索子字符串的的实现代码()
- javascript与asp.net(c#)互相调用方法
- JavaScript 字符串与数组转换函数[不用split与join]
- 魔方在线秒表javascript版
- jQuery 行背景颜色的交替显示(隔行变色)实现代码
- 页面中iframe相互传值传参
- jquery提示 "object expected"的解决方法
- js 加载并解析XML字符串的代码
- javascript 强制刷新页面的实现代码
- ExtJS下grid的一些属性说明
- 用于CSS代码压缩与格式化的javascript函数代码
- javascript 数组使用方法汇总
- jQuery Selectors(选择器)的使用(九、表单对象属性篇)