Skip to main content

Bug Tracker

Side navigation

#9851 closed bug (worksforme)

Opened July 18, 2011 05:20AM UTC

Closed July 21, 2011 11:30AM UTC

Last modified July 29, 2011 05:57AM UTC

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也不行。

Attachments (0)
Change History (7)

Changed July 18, 2011 06:23AM UTC by bd_cool comment:1

Do you understand Chiness? But my English is bad.

Changed July 18, 2011 07:06AM UTC by bd_cool comment:2

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

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

Changed July 19, 2011 12:55AM UTC by bd_cool comment:3

_comment0: I will make a English description as simple. \ \ The ajax does not answer to the response with type:get in XP sp2. \ It does not work with ie6 or ie8, jquery1.3.2 or jquery1.6.2.1311037021409431
_comment1: I will make a English description simply. \ \ The ajax does not answer to the response with type:get in XP sp2. \ It does not work with ie6 or ie8, jquery1.3.2 or jquery1.6.2.1311037189072798
_comment2: 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.1311037414165558

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.

Changed July 19, 2011 01:33PM UTC by timmywil comment:4

component: unfiledajax
owner: → 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.

Changed July 21, 2011 01:34AM UTC by bd_cool comment:5

status: pendingnew

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

But, I do not know how it works.

Changed July 21, 2011 11:30AM UTC by addyosmani comment:6

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.

Changed July 29, 2011 05:57AM UTC by bd_cool comment:7

_comment0: Thanks a lot! \ \ It's OK with code response.getWriter().write(outputString) at the server-side . \ But it's not responding with code response.getWriter().print(outputString). \ \ May be the print method send some invalid charactors to the XP SP2 .1311919178488599
_comment1: 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 .1311921969040127

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 .