Skip to main content

Bug Tracker

Side navigation

#8697 closed bug (duplicate)

Opened March 29, 2011 05:20PM UTC

Closed March 29, 2011 11:42PM UTC

Last modified March 29, 2011 11:43PM UTC

$.ajax fails when data contains '??'

Reported by: Owned by:
Priority: undecided Milestone:
Component: ajax Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Example code:

var js = JSON.stringify({ note: 'questions?? more information' });
    data: js,
    dataType: "json",
    success: function (data) { }
    error: function (XMLHttpRequest, textStatus, errorThrown) { }

I believe that the issue lies in ajaxPrefilter. The jsre is too aggressive and matches the first '??' it finds anywhere in the data string. The '??' gets replaced w/ an anonymous callback function name, such that the server receives the note field as:

    questionsjQuery<anonymous numbering> more information

On return from the server, the ajax call cannot find the anonymous function and goes straight to the error handling instead of calling the success function.

Attachments (0)
Change History (4)

Changed March 29, 2011 05:47PM UTC by comment:1

I apologize for not using jsFiddle. Here is a test case:

Changed March 29, 2011 06:02PM UTC by timmywil comment:2

_comment0: Confirmed and validated json,

Confirmed and validated json,

And switched to jQuery(edge)

Changed March 29, 2011 11:42PM UTC by jaubourg comment:3

component: unfiledajax
resolution: → duplicate
status: newclosed

Changed March 29, 2011 11:43PM UTC by jaubourg comment:4

Duplicate of #8417.