¹ØÓÚjquery1.3.1£¬IE7,IE8ÖÐÎÞ·¨Ê¹ÓÃajaxµÄÌÖÂÛ£¿
´ó¼ÒºÃ£¬×î½üʹÓÃjqueryµÄajax¹¦ÄÜ£¬µ«ÊÇ·¢ÏÖ$.ajax()·½·¨²»ÄÜÌá½»µ½ºǫ́£¬ÎÒÊÇÓõÄÊÇIE7£¬
ÆäËû·½·¨ÈçgetºÍpostûÓÐÊÔ¹ý£¬µ«ÓÉapiËùÖªµ×²ã¶¼ÊÇÓÃajax·½·¨À´ÊµÏֵġ£
ͨ¹ý²é¿´Ô´Âë·¢ÏÖ
// Create the request object; Microsoft failed to properly
// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
// This function can be overriden by calling jQuery.ajaxSetup
xhr:function(){
return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
},
ÒÔÏÂÊÇÕâ¸öjqueryµÄÔ´ÂëµÄ°æ±¾ÉùÃ÷
/*!
* jQuery JavaScript Library v1.3.1
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
* Revision: 6158
*/
ÉÏÊöxhrµÄ´´½¨´úÂëλÖôó¸ÅÊÇÐÐÊýΪ3259µÄλÖã¬
ͨ¹ýÒ»¸öhtml´òÓ¡“window.ActiveXObject ”µÄ½á¹û¿ÉÒÔÖªµÀIE6¡¢IE7ºÍIE8¶¼ÊÇ·µ»ØµÄtrue£¬
²âÊÔµÄhtmlÔ´ÂëΪ£¨Í¬Ò»¸öĿ¼ÏÂÓÐÒ»¸öÃûΪindex.jspÒ³Ãæ£¬ÄÚÈÝÎÞËùν¡££©
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="javascript/jquery.js"></script>
<script type="text/javascript">
$(function (){
$.ajax({
url:"index.jsp",
success:function(){alert("success")},
error:function(){alert("error")}
});
//$("div").append("<font color='red'>window.ActiveXObject:</font>");
//$("div").append((window.ActiveXObject?"true":"false"));
&nbs
Ïà¹ØÎĵµ£º
¹ØÓÚajaxµÄÃû×Ö
ajax µÄÈ«³ÆÊÇAsynchronous JavaScript and XML£¬ÆäÖУ¬Asynchronous ÊÇÒì²½µÄÒâ˼£¬ËüÓбðÓÚ´«Í³web¿ª·¢ÖвÉÓõÄͬ²½µÄ·½Ê½¡£
¹ØÓÚͬ²½ºÍÒì²½
Òì²½´«ÊäÊÇÃæÏò×Ö·ûµÄ´«Ê䣬ËüµÄµ¥Î»ÊÇ×Ö·û£»¶øÍ¬²½´«ÊäÊÇÃæÏò±ÈÌØµÄ´«Ê䣬ËüµÄµ¥Î»ÊÇè壬Ëü´«ÊäµÄʱºòÒªÇó½ÓÊÜ·½ºÍ·¢ËÍ·½µÄʱÖÓÊ ......
½ñÌì³õ´Î½Ó´¥AjaxÄÇôÎÒ½«ÎÒµÄѧϰ¼Ç¼ÏÂÀ´£¬×î½ü¼ÇÐÔ²»Ì«ºÃ¡£±¸Íü°É
1¡¢Ê×ÏÈ´ÓÍøÂ·ÉÏÏÂÔØAjaxÀ©Õ¹°ü£¬VS2008Ö»ÊÇ´ø×Å×î»ù´¡µÄÈý¸öAjax¿Ø¼þ¡£ÄÇôÎÒÃÇÏÂÔØAjaxControlToolkit¿Ø¼þ£¬½«ÏÂÔØºóµÄѹËõ°ü½âѹ¡£ÕÒ³öAjaxControlToolkit.dllËùÔÚλÖá£
2¡¢ÔÚVS2008ÖУ¬ËæÒâÕÒÒ»¸öÑ¡Ï£¬»òÕߣ¬Ð½¨Ò»¸öÑ¡ÏÀ´·ÅÈëÎÒÃÇËù¼ÓÈëµÄ ......
$.ajax({
type: "post",
url: loginUrl,
data: "username=" +uname + "&password=" +pwd,
async: ......
var http_request;
function find(txt) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
http_request.onreadystatechange = function() {
&n ......
µØÖ·£ºhttp://www.qhcar.cc/model/index.aspx?s=5£¬Õâ¸ö¾ÍÊÇǶÌ×ajax½á¹û¡£
http://www.qhcar.cc/model/index.aspx Õâ¸öÊǵ¥¸öµÄajax£¬
Óŵã¾ÍÊÇ¿ÉÒÔÓÃÒ»¸öÒ³ÃæÊµÏÖÏÔʾȫ²¿³µÐͺͰ´¼¶±ðÑ¡Ôñ³µÐÍ£¬ÎªÁËÕչ˵¼º½ÉÏÃæÈç΢ÐͳµµÈÁ´½ÓÔÚ±ðµÄÒ³Ãæ½øÈ룬
http://www.qhcar.cc/model/index.aspx?s=5Õâ¸öµØÖ·²ÎÊýs£¬Åжϵ±s ......