AjaxÅжÏä¯ÀÀÆ÷µÄ·½·¨×ܽá
Ê×ÏÈ°Ñ´úÂë¸ø´ó¼Ò£¬ÏÂÃæÊǽâÊÍ
/**
* »ñµÃXMLHttpRequest¶ÔÏó
*/
function createXHR(){
var x=[function(){return new ActiveXObject("Msxm12.XMLHTTP");},function(){return xmhttp=new ActiveXObject("Microsoft.XMLHTTP");},
function(){return new XMLHttpRequest();}];
for (var i=0; i<x.length; i++) {
try {
return (x[i])();
} catch (e) {
}
};
}
·½·¨Ò»:
//´´½¨Ò»¸ö²¼¶ûÐͱäÁ¿,ÓÃÀ´¼ì²éÊÇ·ñΪºÏ·¨µÄIEʵÀý
var xmlreq = false;
//¼ì²éÊÇ·ñʹÓõÄÊÇIE
try {
//Èç¹ûJavaScriptµÄ°æ±¾´óÓÚ5
xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e1) {
// Èç¹û²»ÊÇ,ÔòʹÓÃÀÏ°æ±¾µÄActiveX¶ÔÏóÀ´¼ì²é
try {
//Èç¹ûʹÓõÄÊÇIEä¯ÀÀÆ÷
xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
// ·ñÔò¿Ï¶¨Ê¹ÓõÄÊÇ·ÇIEä¯ÀÀÆ÷
xmlreq=false;
}
}
}
//Èç¹ûʹÓõÄÊÇ·ÇIEä¯ÀÀÆ÷,Ôò´´½¨Ò»¸ö¸Ã¶ÔÏóµÄJavaSriptʵÀý
if(!xmlreq && typeof XMLHttpRequest!='undefined'){
xmlreq=new XMLHttpRequest();
}
·½·¨¶þ:
//´´½¨Ò»¸ö²¼¶ûÐͱäÁ¿,ÓÃÀ´¼ì²éÊÇ·ñΪºÏ·¨µÄIEʵÀý
var xmlreq = false;
//Èç¹ûActiveX¶ÔÏó¿ÉÓÃ,ÔòʹÓõĿ϶¨ÊÇIE
if (window.ActiveXObject) {
xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
} else {
// ·ñÔò¿Ï¶¨Ê¹ÓÃJavaSript´¦Àí·½·¨
xmlreq=new XMLHttpRequest();
}
·½·¨Èý:
//´´½¨Ò»¸ö²¼¶ûÐͱäÁ¿,ÓÃÀ´¼ì²éÊÇ·ñΪºÏ·¨µÄIEʵÀý
var xmlreq = false;
//
if (window.XMLHttpRequest) {
// Èç¹ûʹÓõÄÊÇ·ÇIEä¯ÀÀÆ÷,Ôò´´½¨Ò»¸ö¸Ã¶ÔÏóµÄJavaSriptʵÀý
xmlreq = new XMLHttpRequest();
} else if (window.ActiveXObject) {
// Create XMLHttpRequest via MS ActiveX
try {
// Èç¹ûJavaScriptµÄ°æ±¾´óÓÚ5
xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e1) {
Ïà¹ØÎĵµ£º
Ajax------ºÜ¶à³ÌÐòÔ±¶¼Ï²»¶ÍæÕâ¸ö¶«Î÷,¾õµÃºÜÊǸßÉîĪ²â,¶øÇÒÔ½ÊÇÍ´¿àÔ½ÖÓ°®,ÎÒ·¢ÏÖÕâÊdzÌÐòÔ±µÄͨ²¡,ºÃÏñ²»ÕÛÄ¥×Ô¼º²»×ãÒÔÏíÊÜÕâôÃÀºÃµÄÉú»î,AjaxºÜ»ð,ȷʵºÜ»ð,»ðµ½Ê²Ã´³Ì¶ÈÎÒÒѾ²»´óÇå³þ,ÔÚµ±Ê±ÎÒѧ³ÌÐòµÄÄǸöÄê´úËüÉõÖÁ³¬¹ýspring,strutsµÈµÈÖ÷Á÷µÄ¿ò¼Ü,ÌìÄÄ΢ÈíºÍSUN¶¼ºÜµ£ÐÄ,µ«ÊÇʱ¼äÖ¤Ã÷Ajax½ö½öÖ»ÊǸöÕâЩ³ÌÐòÔ± ......
Ajax(Asynchronous JavaScript and XML)ÊÇÒ»¸ö½áºÏÁËJava¼¼Êõ¡¢XML¡¢ÒÔ¼°JavaScriptµÄ±à³Ì¼¼Êõ£¬¿ÉÒÔÈÃÄã¹¹½¨»ùÓÚJava¼¼ÊõµÄWebÓ¦Ó㬲¢´òÆÆÁËʹÓÃÒ³ÃæÖØÔصĹßÀý¡£
Ajax£¬Òì²½JavaScriptÓëXML£¬ÊÇʹÓÿͻ§¶Ë½Å±¾ÓëWeb·þÎñÆ÷½»»»Êý¾ÝµÄWebÓ¦Óÿª·¢·½·¨¡£ÕâÑù£¬WebÒ³Ãæ²»Óôò¶Ï½»»¥Á÷³Ì½øÐÐÖØмӲ㬾ͿÉÒÔ¶¯Ì¬µØ¸üС£Ê ......
¸Ã¿Ø¼þ¿ÉÒÔʵÏÖÔÚÒ³ÃæÖе¯³öÒ»¸ö´°¿Ú£¬Õâ¸ö´°¿Ú²»ÊÇÒ»¸öеÄä¯ÀÀÆ÷´°¿Ú£¬¶øÊÇÏâǶÔÚÒ³ÃæÖеÄÒ»¸ö²ã¡£
1 ´´½¨Ò»¸ölinkbutton£¬ÓÃÓÚµã»÷´ò¿ª´°¿Ú¡£
2 ÍÏÈëÒ»¸öpanel£¬Õâ¸ö¾ÍÊÇÎÒÃÇÒªµ¯³öµÄ´°¿Ú¡£ËüÒ²¿ÉÒÔÊÇÁ½¸öǶÌ×µÄpanel¡£Àý³ÌÉÏÊÇÕâÑù×öµÄ£¬»¹ÊÇûÓÐÃ÷°×ΪʲôÕâô×ö¡£
3 ÍÏÈëÒ»¸öModalPopupExtender¿Ø¼þ£¬ÔڸÿؼþµÄta ......
¶àÊý Web Ó¦ÓóÌÐò¶¼Ê¹ÓÃÇëÇó/ÏìӦģÐÍ´Ó·þÎñÆ÷ÉÏ»ñµÃÍêÕûµÄ HTML Ò³Ãæ¡£³£³£Êǵã»÷Ò»¸ö°´Å¥£¬µÈ´ý·þÎñÆ÷ÏìÓ¦£¬ÔÙµã»÷ÁíÒ»¸ö°´Å¥£¬È»ºóÔٵȴý£¬ÕâÑùÒ»¸ö·´¸´µÄ¹ý³Ì¡£ÓÐÁË Ajax ºÍ XMLHttpRequest ¶ÔÏ󣬾ͿÉÒÔʹÓò»±ØÈÃÓû§µÈ´ý·þÎñÆ÷ÏìÓ¦µÄÇëÇó/ÏìӦģÐÍÁË¡£±¾ÎÄÖУ¬Brett McLaughlin ½éÉÜÁËÈçºÎ´´½¨Äܹ»ÊÊÓ¦²»Í¬ä¯ÀÀÆ÷µÄ ......
ʹÓÃAJAXÖеÄUpdatePanel
ÔÚUpdatePanelÖÐÌí¼ÓÒ»GridView,Ìí¼ÓÁËRow_Updatingʼþ£º protected void gvUnitList_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = gvUnitList.Rows[e.RowIndex];
UnitModel unit = new UnitModel();
unit.UnitID = Convert.ToI ......