firefoxÏµĹØÓÚajaxµÄÎÊÌâ
JScript code:
var url="Test.aspx?id=1"
xmlHttp.open("GET",url,false);
xmlHttp.onreadystatechange= function()
{
if (xmlHttp.readyState == 4)
{
alert(xmlHttp.responseText);
}
}
xmlHttp.setRequestHeader("Content-Type", "text/xml");
xmlHttp.setRequestHeader("charset", "gb2312");
xmlHttp.send(null);
Õâ¶Î´úÂëÔÚfirefoxϲ»ºÃÓà ¸ù±¾Ã»Ö´ÐÐalertº¯Êý
ÎÒÒѾ¸ú×ÙÁËxmlHttp.readyState·¢ÏÖËüÒѾ±ä»¯ÁË ÓÉ4±äΪ1ÓÖ±äΪ4
xmlHttpµÄÉùÃ÷ûÓÐÎÊÌâ
sf
up
ffÖпؼþ̨±¨Ê²Ã´´íÎóûÓÐ? µ÷ÊÔÏ ÔÙÕÒЩ×ÊÁÏ¿´ÏÂ
ÊDz»ÊÇ»¹Óиö==200µÄÅжϰ¡£¬Â¥Ö÷ÄãÈ¥ÍøÉÏÕÒÕÒÕâ¸öjsµÄAJAX
Ê×ÏÈ£º
JScript code:
if (xmlHttp.readyState == 4)
{
if(xmlHttp.status==200) {
alert(xmlHttp.responseText);
}
}
ÁíÍ⻹ÓÐ
ff3.0+µÄajaxͬ²½ÎÊÌ⣬Çë²Î¿¼£ºhttp://www.code-design.cn/blogdetail267.html
200ÄǸöÊÇÎÒÍüдÁË sorry...
ÎÒÔÚÍøÉϲéµÄ×ÊÁÏ£¬
³ý·ÇÓÃͬ²½µÄ·½Ê½ Ò²¾ÍÊÇxmlHttp.open("GET",url,true);
·ñÔòµÄ»°£¬firefox²¢²»»áÖ´ÐÐonreadystatechangeÕâ¸ö
˵ÊÇÓÉÓÚfirefoxµÄ»úÖÆµ¼Ö嵀 ÐèÒªÓõ½jsµÄ±Õ°ü ²»Ì«À
Ïà¹ØÎÊ´ð£º
ǰ̨´úÂ룺
C# code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tttt.aspx.cs" Inherits="tttt" %>
<%@ Register Assembly="System.W ......
AJAX´«ÊäJSONÊý¾Ý.¶ÔÓÚÖÐÎÄÈç¹ûʹÓÃUTF8±àÂë
ÎÒµÄÈÕÖ¾ÎļþÖмǼµÄ´«ÊäµÄ3¸öÖÐÎÄÈç"\u8d85\u7ea7\u798f"
ÔÚʵ¼Ê´«ÊäÖÐÊDz»ÊÇÕ¼ÓÃ18¸ö×Ö½Ú..
Ò²¾ÍÊÇ˵һ¸öÖÐÎÄʹÓÃJSON´«ÊäÔòÿ¸öÖÐÎÄÐèÒªÕ¼ÓÃ6×Ö½ ......
ajax˸ã³öÀ´µÄ¼¼Êõ°¡
µ½µ×Ôõô»ØÊ°¡£¬ÊÇ΢ÈíŪµÄÂ𣬻¹ÊÇgoogle °¡£¬»¹ÊÇÄĸöä¯ÀÀÆ÷¹«Ë¾°¡
The concept behind the XMLHttpRequest object was originally created by the developers of Outlook Web Ac ......
ssh»òÕßÊÇAJAXµ¥¶ÀÓÃû³ö´í£¬¿ÉÊÇÁ½¸öÒ»½áºÏ¾Í±¨´íÁË
ÒÔÏÂÊÇweb.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" ......