jQuery Ajax È«½âÎö
jQuery Ajax È«½âÎö
±¾ÎĶÌÖ·£ºhttp://s8.hk/0itq
<!--
.ajax div{
border: solid 1px red;
}
-->
// <![CDATA[
$(function(){
$("#btnajax").click(function(){
$.ajax({
type: "get",
url: "/rss",
beforeSend: function(XMLHttpRequest){
$('<div class="quick-alert">Êý¾Ý¼ÓÔØÖУ¬ÇëÉÔºó</div>')
.insertAfter( $("#btnajax") )
.fadeIn('slow')
.animate({opacity: 1.0}, 3000)
.fadeOut('slow', function() {
$(this).remove();
});
},
success: function(data, textStatus){
$(".ajax.ajaxResult").html("");
$("item",data).each(function(i, domEle){
$(".ajax.ajaxResult").append("<li>"+$(domEle).children("title").text()+"</li>");
});
},
complete: function(XMLHttpRequest, textStatus){
//HideLoading();
},
error: function(){
//ÇëÇó³ö´í´¦Àí
}
});
});
$("#btngetScript").click(function(){
$(this).attr("disabled","true");
$.getScript("http://files.cnblogs.com/QLeelulu/AjaxEvent.js", function(){
alert("AjaxEvent.js ¼ÓÔØÍê³É²¢Ö´ÐÐÍê³É.ÄãÔÙµã»÷ÉÏÃæµÄGet»òPost°´Å¥¿´¿´ÓÐʲô²»Í¬£¿");
$("#btnremoveScript").attr("disabled","");
});
});
$("#btnremoveScript").click(function(){
$(this).attr("disabled","true");
$("#btngetScript").attr("disabled","");
$("body").unbind();
});
$("#btnpost").click(function(){
$.post("http://qleelulu.atx41.idc800.net/jQuery/Ajax.aspx", { Action: "post", Name: "lulu" },
function (data, textStatus){
// data ¿ÉÒÔÊÇ xmlDoc, jsonObj, html, text, µÈµÈ.
//this; // Õâ¸öAjaxÇëÇóµÄÑ¡ÏîÅäÖÃÐÅÏ¢£¬Çë²Î¿¼jQuery.g
Ïà¹ØÎĵµ£º
ʲôÊÇ AJAX?
¡¡¡¡AJAX (Òì²½ JavaScript ºÍ XML) ÊǸöвúÉúµÄÊõÓï,רΪÃèÊöJavaScriptµÄÁ½ÏîÇ¿´óÐÔÄÜ.ÕâÁ½ÏîÐÔÄÜÔÚ¶àÄêÀ´Ò»Ö±±»ÍøÂ翪·¢ÕßËùºöÂÔ,Ö±µ½×î½üGmail, Google suggestºÍgoogle MapsµÄºá¿Õ³öÊÀ²ÅʹÈËÃÇ¿ªÊ¼Òâʶµ½ÆäÖØÒªÐÔ.
¡¡¡¡ÕâÁ½Ïî±»ºöÊÓµÄÐÔÄÜÊÇ:
¡¡¡¡ÎÞÐèÖØÐÂ×°ÔØÕû¸öÒ³Ãæ±ãÄÜÏò·þÎñÆ÷·¢ËÍÇëÇó.
¡¡¡ ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for Commen ......
ʵʱÊý¾ÝÑéÖ¤ÊÇAJAX¼¼ÊõµÄÒ»´óÓÅÊÆÖ®Ò»¡£Í¨¹ýÓ¦Óô˼¼Êõ£¬strutsÑéÖ¤¿ò¼Ü½«ÔöÇ¿struts MVC£¬²¢Ê¹WebÓ¦ÓóÌÐò¸ü½Ó½üÓÚ×ÀÃæÓ¦ÓóÌÐò¡£
´ËÑéÖ¤¿ò¼ÜÓÃÓÚÑéÖ¤×ֶΡ£ÓÐÐí¶àÔÚWebÓ¦ÓóÌÐòÉϽøÐÐÑéÖ¤µÄ·½·¨¡£ÕâЩ·½·¨¿É·ÖΪÁ½Àࣺ·þÎñÆ÷¶Ë·½·¨ºÍ¿Í»§¶Ë·½·¨¡£StrutsÑéÖ¤¿ò¼ÜÊÇÃæÏò»ùÓÚJavaµÄWebÓ¦Óû·¾³µÄ×î¼Ñ¿ò¼ÜÖ®Ò»¡£ËüÄܹ»ÅäÖÃÓ ......
¿Í»§¶Ë´úÀíµÄ×÷ÓÃ
ÔÚ¶ÔÏóÀï×öÁËÒ»¸ö±ê¼Ç
–“__type” = “ComplexType.Color”
·þÎñÆ÷¶Ë¸ù¾Ý±ê¼ÇÑ¡Ôñ·´ÐòÁл¯µÄÄ¿±êÀàÐÍ
¿É³öÏÖ“¶à̬”Ч¹û
Employee.cs Code£º
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Secu ......
$(function(){
new AjaxUpload('file1', {
action: 'uploadpic.asp',
name: 'form1',
data:{act:'uploadfile',FormName:'form1'},
autoSubmit:false,
responseType:'json',
onSubmit:function(file,ext){
if (!(ext && /^(jpg|png|gif)$/i.test(ext))){
alert('ÇëÄúÉÏ´« ......