Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9851 closed bug (worksforme)

jquery的ajax在XP sp2系统不能响应

Reported by: bd_cool Owned by: bd_cool
Priority: low Milestone: 1.next
Component: ajax Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

XP sp3一切正常,在sp2没有响应。 请求已经发送到服务器,服务器工作正常,但ajax既不执行success,也不执行error,也不执行complete。 上代码 $.ajax({

type: "get", async:false, timeout:10000, url: "/login.do", data: "username="+userName+"&pwd="+password+"&d="+new Date(), contentType:"text/html", success: function(responseText){

alert("searchUserInfo_2");

} , error:function(x,e){

alert("searchUserInfo_3");

}, complete:function(jqXHR, textStatus){

alert("searchUserInfo_4");

}

});

另外,以下方式可以通过 var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.Open("GET",CURL, false); try {

xmlhttp.Send(); var resultNum = xmlhttp.status;

if(resultNum==200) {

return true;

}

} catch(e) {}

=================== sp2默认ie6,升级到ie8问题仍然存在,只能打上sp3补丁。

原来 jquery1.3.2,升级到最新1.6.2也不行。

Change History (7)

comment:1 Changed 8 years ago by bd_cool

Do you understand Chiness? But my English is bad.

comment:2 Changed 8 years ago by bd_cool

If it changes to [type: "post"] , it's OK.

But I must use "get" ,I will read from IE catch when the line off.

comment:3 Changed 8 years ago by bd_cool

I will make a English description simply.

The ajax does not answer to the response with type:get in XP sp2. Neither success and error nor complete method be called.

It does not work with ie6 or ie8, jquery1.3.2 or jquery1.6.2.

But it works fine in XP sp3 and Win7.

Last edited 8 years ago by bd_cool (previous) (diff)

comment:4 Changed 8 years ago by timmywil

Component: unfiledajax
Owner: set to bd_cool
Priority: undecidedlow
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsfiddle.net that reproduces the issue experienced to help us assess your ticket.

Additionally, test against the jQuery (edge) version to ensure the issue still exists.

comment:5 Changed 8 years ago by bd_cool

Status: pendingnew

I have add a fiddle http://jsfiddle.net/ag953/1/.

But, I do not know how it works.

comment:6 Changed 8 years ago by addyosmani

Resolution: worksforme
Status: newclosed

Here is a translation from google translate, followed by my response:


XP sp3 everything is normal, the sp2 is not responding. Request has been sent to the server, the server works fine, but not execute ajax success, do not perform error, do not perform complete. The code $. Ajax ({

type: "get", async: false, timeout: 10000, url: "/ login.do", data: "username =" + userName + "& pwd =" + password + "& d =" + new Date (), contentType: "text / html ", success: function (responseText) {

alert ("searchUserInfo_2");

}, Error: function (x, e) {

alert ("searchUserInfo_3");

}, Complete: function (jqXHR, textStatus) {

alert ("searchUserInfo_4");

}

});

In addition, the following methods can be var xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP"); xmlhttp.Open ("GET", CURL, false); try {

xmlhttp.Send (); var resultNum = xmlhttp.status;

if (resultNum == 200) {

return true;

}

} Catch (e) {}

=================== Sp2 default ie6, upgrading to ie8 problem still exists, can only be marked with sp3 patch.

Original jquery1.3.2, upgrade to the latest 1.6.2 does not work.


Thanks for submitting a ticket. I've just re-tested the $.ajax .success(), .complete() and .error() methods with jQuery edge (1.6.2+) and they all appear to be working fine with suggests there is something wrong with the server-side login.do you appear to be calling. If you take a look at the test cases below, you'll see the $.ajax methods mentioned working fine on jsfiddle.net.

Demonstration of .success and .complete working fine: http://jsfiddle.net/addyosmani/2vMgE/ Demonstration of .error working fine: http://jsfiddle.net/addyosmani/2vMgE/1/ With async false: http://jsfiddle.net/addyosmani/2vMgE/2/

Closing as this does not appear to be an issue related to core's $.ajax module functioning incorrectly.

comment:7 Changed 8 years ago by bd_cool

Thanks a lot!

It's OK with the code below at the server-side .

response.getWriter().write(outputString)

But it's not responding with code

response.getWriter().print(outputString).

May be the print method send some invalid charactors to the XP SP2 .

Last edited 8 years ago by bd_cool (previous) (diff)
Note: See TracTickets for help on using tickets.