jQuery AjaxÖ®$.get()·½·¨ºÍ$.post()·½·¨
×¢Ò⣺$.get()ºÍ$.post()·½·¨ÊÇjQueryÖеÄÈ«¾Öº¯Êý¡£Ç°Ãæ½²µ½µÄload()·½Ê½ÊǶÔjQuery¶ÔÏó½øÐвÙ×÷µÄ¡£
1¡¢ $.get()·½·¨
¡¡¡¡$.get()·½·¨Ê¹ÓÃGET·½Ê½À´½øÐÐÒì²½ÇëÇó¡£
¡¡¡¡ËüµÄÓï·¨½á¹¹Îª£º
¡¡¡¡$.get( url [, data] [, callback] [, type] )
¡¡¡¡$.get()·½·¨²ÎÊý½âÊÍÈçÏÂ±í£º
²ÎÊýÃû³Æ
Àà¡¡ÐÍ
˵¡¡¡¡Ã÷
url
String
ÇëÇóµÄHTMLÒ³µÄURLµØÖ·
data£¨¿ÉÑ¡£©
Object
·¢ËÍÖÁ·þÎñÆ÷µÄkey/valueÊý¾Ý»á×÷ΪQueryString¸½¼Óµ½ÇëÇóURLÖÐ
callback£¨¿ÉÑ¡£©
Function
ÔØÈë³É¹¦Ê±µÄ»Øµ÷º¯Êý£¨Ö»Óе±ResponseµÄ·µ»Ø״̬ʱsuccess²Åµ÷Óø÷½·¨£©×Ô¶¯½«ÇëÇó½á¹ûºÍ״̬´«µÝ¸ø¸Ã·½·¨
type£¨¿ÉÑ¡£©
String
·þÎñÆ÷¶Ë·µ»ØÄÚÈݵĸñʽ£¬°üÀ¨xml¡¢html¡¢script¡¢json¡¢textºÍ_default
Ïà¹ØÎĵµ£º
×î½ü¿ªÊ¼ÁËASP.NET AJAXµÄÈ«Ãæѧϰ¡£ÔÚ·þÎñ¶Ë±à³ÌÕâ¿éÖ÷ÒªÓм¸¸ö·þÎñÆ÷¿Ø¼þ¸ºÔð£¬ËûÃÇ·Ö±ðΪ:ScriptManager,Timer,UpdatePanel,UpdateProgress.
ÏÈÀ´ËµËµScriptManager.ËüÓиö·½·¨registerAsyncPostBackControl(¿Ø¼þ)£¬¿ÉÒÔ×¢²áÒ³ÃæÉϵÄÈκοؼþΪÒì²½´«ËÍ°´Å¥¡£»¹Óиö·½·¨½Ð ......
ÄÚÈÝÒ³£º
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ScriptManagerProxyDemo.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javas ......
Client¶Ë
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="javascript">
var XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
function sendAJAX()
{
&nb ......
´´½¨ÓÃÓÚ±£´æͼƬµÄ±í£º
create table stockImages
( imageid int primary key identity(1,1),
[filename] varchar(50),
img varbinary(max))
²åÈë±¾µØͼƬ£º
insert into stockImages
select '·ç¾°',bulkcolumn
from openrowset(bulk 'd:\\img.jpg',single_blob) as x
´´½¨´æ´¢¹ý³Ì£¬¼ìË÷ͼƬ£¬½«¶ ......