Ajax2
一、完整版Ajax
$.ajax({
url: "Ashxs/Login.ashx",
data: { "name": name, "pwd": pwd },
type: "post",
dataType: "json",
success: function (data) {
if (data.has == "") {
$("#span_error").text('用户名密码错误!');
}
else {
window.location.href = "HtmlPage2.html";
}
},//success
error: function () {
$("#span_error").text('服务器连接失败!');
},//服务器连接不上或是服务器内容有错误时执行
beforeSend: function () {
$("#txt_username").attr('disabled', 'disabled');
$("#txt_password").attr('disabled', 'disabled');
$("#btn1").attr('disabled', 'disabled');
$("#btn1").val('登陆中...');
},//执行ajax时先执行beforeSend再执行其它
complete: function () {
$("#txt_username").removeAttr('disabled');
$("#txt_password").removeAttr('disabled');
$("#btn1").removeAttr('disabled');
$("#btn1").val('登 陆');
}//执行完beforeSend后恢复原状
});//btn1.ajax
Ajax2的更多相关文章
- AJAX2.0
Ajax2.0 早期的ajax技术不支持异步文件上传 在后面更新了ajax2.0版本 支持文件上传了 但需要借助一个对象----FormData对象 Ajax2.0大体的步骤跟以前是一样的 但也是 ...
- Ajax2简单的使用方式
http://www.cnblogs.com/Ming8006/p/6142191.html
- 新手学ajax2
今天主要解决了一个困扰两天的ajax问题,就是关于从服务器获取数据时的同步和异步问题 , xhr.open("GET", url,false): 这里有三个参数“GET”表示获取的 ...
- ajax-2
serialize()输出序列化表单值的结果: 如: <html> <head> <script type="text/javascript" src ...
- AjAX2 异步通信 异常处理
<!DOCTYPE html> <html lang="en"> <head> <title>xmlhttprequest ajax ...
- ajax2.0之拖拽上传
index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> &l ...
- ajax2.0之文件上传加跨域
express_server.js const express=require('express'); //主体 const body=require('body-parser'); //接收普通PO ...
- 前端之ajax
前端之ajax 本节内容 ajax介绍 原生js实现ajax jquery实现ajax json 跨域请求 1. ajax介绍 AJAX(Asynchronous Javascript And XML ...
- 【JavaScript】--ajax
1 什么是AJAX AJAX(Asynchronous Javascript And XML)翻译成中文就是“异步Javascript和XML”.即使用Javascript语言与服务器进行异步交互,传 ...
随机推荐
- 035. asp.netWeb用户控件之四通过用户控件实现投票和结果分析
用户控件Vote.ascx代码 <%@ Control Language="C#" AutoEventWireup="true" CodeFile=&qu ...
- linux -小记(1) 问题:"linux ifconfig查看网卡名称与配置文件不否" 或 启动网卡提示“ eth0 似乎不存在, 初始化操作将被延迟”。
"linux ifconfig查看网卡名称与配置文件不否" 或 启动网卡提示" eth0 似乎不存在, 初始化操作将被延迟" . 问题 1. service n ...
- C#后台程序重启IIS,发邮件通知
应用场景:IIS网站挂掉,系统自动重启IIS,通知相关联系人: 主要代码: 监控类 public class monitoringiis { EmailSend send = new EmailSen ...
- 报错:严重: Servlet.service() for servlet [jsp] in context with path [/20161116-Struts2-6] threw exception [/index.jsp (line: 13, column: 20) No tag "textfiled" defined in tag library imported with prefix
严重: Servlet.service() for servlet [jsp] in context with path [/20161116-Struts2-6] threw exception [ ...
- Asp.net MVC 视图引擎
Asp.net MVC视图引擎有两种: 1.ASPX View Engine 这个做过WebForm的人都清楚 设计目标:一个用于呈现Web Form页面的输出的视图引擎. 2.Razor View ...
- Unity5版本的AssetBundle打包方案之打包Scene场景
using UnityEngine; using System.Collections; using UnityEditor; /// <summary> /// 脚本位置:Editor文 ...
- XMPP协议错误码
302 重定向 尽管HTTP规定中包含八种不同代码来表示重定向,Jabber只用了其中一个(用来代替所有的重定向错误).不过Jabber代码302是为以后的功能预留的,目前还没有用到 400 坏请求 ...
- Tomcat中解决sql server连接失败--- java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
php连接mysql数据库很容易,他俩真是黄金搭档.最近转战java连接微软sqlServer,步骤稍微复杂一点,但也不是太难,中途遇到了一点小问题,最后在csdn论坛里找到了答案http://bbs ...
- Node.js初探之hello world
昨天公司内部培训,主讲人王老板对Node.js评价很高,连用几个“变态”来形容,恰好今天周末,有时间来认识下Node.js,对一门新语言最好的认识,是让其输出“hello world”,今天我就利用N ...
- Android RadioGroup设置默认选中项
今天有人问.Android 里面 RadioGroup里面有两个RadioButton怎么设置默认值? 第一个RadioButton设置 android:checked="true" ...