AjaxʾÀý
¿Í»§¶Ë´úÂ룺
var xmlHttp;
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}
}
function sl(url){
//¿É¼ÓһЩÑéÖ¤ÐÅÏ¢
document.getElementById('slform').style.display='';//´ò¿ªÊÜÀíform
//alert("url="+url);
createXMLHttpRequest();//Ϊ xmlHttp ¸³Öµ
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = slcallback;
xmlHttp.send(null);
}
function slcallback(){
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
var applyPerson = xmlHttp.responseXML.getElementsByTagName('applyPerson')[0].firstChild.data;
var applyIdCard = xmlHttp.responseXML.getElementsByTagName('applyIdCard')[0].firstChild.data;
document.getElementById('slPerson').value=applyPerson;
document.getElementById('slId').value=applyIdCard;
}
}else{
}
}
ÔÚactionÀ·µ»Øµ½Ò»¸öjspÒ³Ã棬ÔÚjspÒ³ÃæÀï°ÑÄÚÈÝÉèΪxml¸ñʽ
ÈçÏ£º
<%@ page contentType="text/xml; charset=GBK"%>
<%
String applyPerson = (String)request.getAttribute("applyPerson");
String applyIdCard = (String)request.getAttribute("applyIdCard");
%>
<?xml version="1.0" encoding="GBK"?>
<response>
<applyPerson><%=applyPerson%></applyPerson>
<applyIdCard><%=applyIdCard%></applyIdCard>
</response>
Ïà¹ØÎĵµ£º
×î½üµÄÏîÄ¿ÀïÓõ½AjaxControlToolkit 3.5,ÏîÄ¿Íê³ÉÒÔºóÔÚ±¾µØ²âÊÔûÎÊÌ⣬·Åµ½·þÎñÆ÷ÉÏÈ¥ÔÚIE6¾Í³öÏÖAjax ¿Í»§¶Ë¿ò¼ÜδÄܼÓÔصÄÎÊÌ⣬ÔÚFF£¬IE7£¬Opera£¬SafariµÈä¯ÀÀÆ÷¶¼Ã»ÎÊÌ⣬ÕæÊǸ㲻¶®MSÔõô¸ãµÃ£¬ÏÖÔÚ ¾ÍÏëÅ×ÆúIE6£¬ÕҵĺÃÐÁ¿à°¡£¬ÍøÉÏ˵µÄ½â¾ö·½°¸¶¼ÊÔ¹ýÁË£¬¶¼Ã»Óã¬×îºóÕÒµ½µÄ´ð°¸ÊÇ£ºÓ¦ÓóÌÐòµÄ±àÂëÎÊ Ì⣬ֻҪÔÚ ......
Thickbox
-
»ùÓÚ
jQuery
£¬Ö§³Ö AJAX£¬ÇáÁ¿¼¶µÄ¶øÇұȽϸßЧ¡£Ö§³ÖͼƬÓëHTMLÄÚÈÝ¡£´óСԼΪ
40k£¬Ä¿Ç°»¹¿É×÷Ϊ WordPress
µÄ²å¼þʹÓá£Õâ¸öjsµÄÓŵãÔÚÓÚÓ룬¸¸¼¶µÄÔÒ³Ãæ¹ö¶¯ÌõËæÊó±ê¹ö¶¯µÄʱºò£¬µ¯³öµÄ²ã²¢²»Òƶ¯£¬¶øʼÖÕ´¦ÓÚä¯ÀÀÆ÷µÄ¹Ì¶¨Î»Öá£
GreyBox
- ´´½¨ iframe µÄµ¯³ö½çÃ棬¿ÉʹÓÃͼƬ ......
var httpRequest = false;
var mesdivs = null
function sendRequest(url, mesdiv) {
mesdivs = mesdiv;
httpRequest = false;
if (window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
......
Web¿ª·¢Õß²»»á×¢Òâµ½ÓÉ “AJAX(Asynchronous JavaScript And XML)”Ëù´øÀ´µÄ¼¤Çé¡£²»·ÑÁ¦Æø¾ÍÄÜ´´½¨ÏñGoogle SuggestÄÇÑùµÄÖÇÄÜÍøÕ¾»òÕßÏñGmailÄÇÑù»ùÓÚWebµÄÓ¦ÓóÌÐò£¬ÕâÔںܴó³Ì¶ÈÉÏÒª¹é¹¦ÓÚÕâÖÖ¼¼Êõ¡£È»¶ø£¬°éËæ×ÅAJAXÓ¦ÓóÌÐòµÄ·¢Õ¹£¬ÎÒÃÇ·¢ÏÖÁËËüµÄһЩ²»×ãÖ®´¦£¬ÎÒÃÇ·¢ÏÖËüµÄ°²È«Â©¶´Ò²ÔÚÖð½¥±ä´ó£¬¾ÍÏñÂý ......