jquery AJAX 三个发送状态 posting, error, success

时间:2010-07-31 18:59:00 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>shawl.qiu template</title>
<script type='text/javascript' src='/js/jquery/jquery-latest.js'></script>
</head>
<body>

<script type="text/javascript">
/*<![CDATA[*/

$.ajax
(
 {
  type:"GET"
  , cache: false
  , url: "/"
  , beforeSend:
   function(XMLHttpRequest, textStatus)
   {
    $('<div>posting</div>').appendTo('body');
   }
  , error:
   function(XMLHttpRequest, textStatus, errorThrown)
   {
    $('<div>error</div>').appendTo('body');
    alert('ok');
   }
  , success:
   function(data_)
   {
    $('<div>success</div>').appendTo('body');
   }
 }
);/* $.ajax */

$.ajax
(
 {
  type:"GET"
  , cache: false
  , url: "/nopath/"
  , beforeSend:
   function(XMLHttpRequest, textStatus)
   {
    $('<div>posting</div>').appendTo('body');
   }
  , error:
   function(XMLHttpRequest, textStatus, errorThrown)
   {
    $('<div>error</div>').appendTo('body');
    alert('ok');
   }
  , success:
   function(data_)
   {
    $('<div>success</div>').appendTo('body');
   }
 }
);/* $.ajax */

/*]]>*/
</script>
</body>
</html>

标签:Javascript,jQuery,AJAX
0
投稿

猜你喜欢

  • ASP转化ip地址为长整型数字

    2008-04-06 14:23:00
  • WEB设计经验-来自Microsoft

    2008-05-15 07:30:00
  • 比较SQL Server约束和DML触发器

    2008-12-24 15:54:00
  • 如何使用数据绑定控件实现不换页提交数据?

    2010-05-16 15:17:00
  • sql中 RecordCount=-1问题

    2008-03-02 17:18:00
  • Oracle字符集修改查看方法

    2009-11-05 21:45:00
  • 用CSS定义 li 样式

    2007-09-28 20:56:00
  • 分类与类型的问题

    2008-09-12 13:10:00
  • Javascript 中对中文长度对行判断

    2009-07-05 18:39:00
  • 5个款MySQL常用维护管理工具

    2010-10-25 19:45:00
  • 浅谈javascript面向对象编程

    2009-03-03 12:04:00
  • WEB2.0网页制作标准教程(5)head区的其他设置

    2007-11-13 13:28:00
  • asp自带的内存缓存 application

    2011-03-09 11:18:00
  • 三条asp语句搞定路径

    2007-10-22 13:30:00
  • js全选/全不选/反选 checkbox代码

    2008-03-18 13:00:00
  • 使用VS2005调试ASP程序方法

    2007-11-02 09:56:00
  • form的submit方法和submit事件(onsubmit)

    2008-09-28 13:29:00
  • asp如何准确获知对方来访问的时间和URL?

    2010-07-07 12:25:00
  • z-blog文章摘要图文混排

    2009-02-28 13:49:00
  • 关于H1的位置

    2008-04-30 12:20:00
  • asp之家 网络编程 m.aspxhome.com