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
Ïà¹ØÎĵµ£º
Êý¾Ý±íwords½á¹¹
CREATE TABLE `words` ( & ......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<titl ......
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode=Conditional>
<ContentTemplate>
<%=DateTime.Now %>
</ContentTemplate>
</asp:UpdatePanel> ......
ÏÖÔÚµÄÍøÒ³ÓÐÏ൱һ²¿·ÖÊDzÉÓÃÁËAJAX¼¼Êõ,²»¹ÜÊDzÉÓÃC#ÖеÄWebClient»¹ÊÇHttpRequest¶¼µÃ²»µ½ÕýÈ·µÄ½á¹û,ÒòΪÕâЩ½Å±¾ÊÇÔÚ·þÎñÆ÷·¢ËÍÍê±Ïºó²ÅÖ´ÐеÄ!
µ«ÎÒÃÇÓÃIEä¯ÀÀÒ³ÃæʱÊÇÕý³£µÄ,ËùÒÔ½â¾ö·½·¨Ö»ÓÐ1¸ö¾ÍÊDzÉÓÃWebBrowser¿Ø¼þ
µ«ÊÇʹÓÃWebbrowserÄã»á·¢ÏÖ,ÔÚDownloadCompleteʼþÖÐ,Äã¸ù±¾ÎÞ·¨ÖªµÀÒ³ÃæºÎʱ²ÅËãÊÇÕæÕýµ ......
var XmlHttp;
var PathUrl;
function createXmlHttp() {
if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
  ......