AjaxÖÐsend²ÎÊý
Ò»°ãÇé¿öÏ£¬Ê¹ÓÃAjaxÌá½»µÄ²ÎÊý¶àÊÇЩ¼òµ¥µÄ×Ö·û´®£¬¿ÉÒÔÖ±½ÓʹÓÃGET·½·¨½«ÒªÌá½»µÄ²ÎÊýдµ½open·½·¨µÄurl²ÎÊýÖУ¬´Ëʱsend·½·¨µÄ²ÎÊýΪnull¡£
ÀýÈç £º
var url = "login.jsp?user=XXX&pwd=XXX";
xmlHttpRequest.open("GET",url,true);
xmlHttpRequset.send(null);
´ËÍ⣬Ҳ¿ÉÒÔʹÓÃsend·½·¨´«µÝ²ÎÊý¡£Ê¹ÓÃsend·½·¨´«µÝ²ÎÊýʹÓõÄÊÇPOST·½·¨£¬ÐèÒªÉ趨Content-TypeÍ·ÐÅÏ¢£¬Ä£ÄâHTTP POST·½·¨·¢ËÍÒ»¸ö±íµ¥£¬ÕâÑù·þÎñÆ÷²Å»áÖªµÀÈçºÎ´¦ÀíÉÏ´«µÄÄÚÈÝ¡£²ÎÊýµÄÌá½»¸ñʽºÍGET·½·¨ÖÐurlµÄд·¨Ò»Ñù¡£ÉèÖÃÍ·ÐÅϢǰ±ØÐëÏȵ÷ÓÃopen·½·¨¡£
ÀýÈ磺
xmlHttpRequest.open("POST","login.jsp",true);
xmlHttpRequest.setRequestHeder("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
xmlHttpRequest.send("user="+username+"&pwd="+password);
ÐèҪעÒâµÄÊǸù¾ÝÌá½»·½Ê½µÄ²»Í¬£¬Á½ÖÖÌá½»·½Ê½·Ö±ðµ÷Óúǫ́µÄdoGet·½·¨ºÍdoPost·½·¨¡£
Ïà¹ØÎĵµ£º
½ñÌìͬʸæËßÎÒµÄÒ»¸öÀý×Ó£¬ÔÝʱûÓÐʱ¼äÇ××ÔÊÔÑ飬Ïȼǵ½ÕâÀï¡£
jQuery(document).ready(function(){
$.ajax({
......
ICallbackEventHandler
aspx Ò³Ã棺
function CallServer(PhotoId)
{
document.getElementById("updatediv").style.display = "block";
documen ......
½ñÌìС±àºÍ´ó¼Ò·ÖÏíµÄÊÇJSON²å¼þʵÏÖAjax£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1£¬JSON»ù´¡ÖªÊ¶
JSON²å¼þÊÇStruts2µÄAjax²å¼þ£¬Í¨¹ýÀûÓÃJSON²å¼þ£¬ÔÊÐí¿ª·¢ÕßÒԷdz£Áé»î¼òµ¥µÄ·½Ê½À´¿ª·¢AjaxÓ¦Óá£
JSONµÄÈ«³ÆÊÇJavaSrcipt Object Notation,¼´JavaScript¶ÔÏó·ûºÅ,ËüÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ.JSONµÄÊý¾Ý¸ñʽ¼ÈÊʺÏÈ ......
µ½Èí¼þ¹«Ë¾Ñ§IT¼¼Êõhttp://www.tsp2c.cn/
Ajax Ó¦¸Ã²»ÊÇÒ»Ïî¼¼Êõ£¬ÊÇÒ»ÖÖ˼Ïë¶øÒÑ£¬¸ú ASP.NET ÒÔ¼°ÆäËü Web ¿ª·¢ÓïÑÔûÓÐʲô̫´ó¹Øϵ£¬ÕâÀïÖ»ÊÇ̸̸ ASP.NET ÖÐĿǰʹÓÃµÄ Ajax ¼¼ÊõÒÔ¼°ÆäËüһЩʵÏÖ Ajax µÄÓÅÐã¿ò¼Ü¡£
¡¡¡¡Ajax ÒѾºÜÁ÷ÐÐÒ»Õó×ÓÁË£¬ÏÖÔÚ̸ Ajax ¾õµÃÓеãÀÏÍÁ¡£Ä¿Ç°ËùνµÄ Web2.0 ÍøÕ¾£¬»ù±¾ÉÏûÓв» ......
1. ¾µÍ·Ç¨áãÓ¦µ±Ó¦ÓÃʵʩ¾µÍ·Öض¨ÏòµÄResponse.Redirect¶ø²»ÊÇServer.Transfer£¬ÓÉÓÚServer.Transfer²»¸Ä±äIE¿Í»§¶ËURL£¬ÄÜÒÔÖÂASP.NET AJAX¿Í»§¶Ë½Å±¾·ÃÎÊ×ÊÔ´µÄʱ·Ö³öÏÖURL´í´¦¡£
¶þ.ÔÚ·þÎñÆ÷¶ËµÇ¼Ç½Å±¾ºÍÑÚ²Ø×Ö¶ÎÓ¦µ±Ê©ÓÃÖÖScriptManager£¬¶ø²»ÊÇPage.ClientScript¶ÔÏó£¬ÓÉÓÚPage.ClientScriptµÄ²½ÖèÊǽ«½Å±¾µÇ¼Ç ......