Skip to main content

Bug Tracker

Side navigation

#8267 closed bug (worksforme)

Opened February 14, 2011 09:48AM UTC

Closed February 14, 2011 12:27PM UTC

Last modified May 05, 2011 11:13PM UTC

$.ajax, dataFilter broken

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: ajax Version: 1.5
Keywords: Cc:
Blocked by: Blocking:
Description

jQuery ajax success method no longer receives any data when using the dataFilter method and returning sanitized data.

Attachments (0)
Change History (4)

Changed February 14, 2011 12:27PM UTC by jitter comment:1

component: unfiledajax
priority: undecidedlow
resolution: → worksforme
status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

As you didn't provide the test case (or any of the other data) requested in the bug reporting guidelines, I went ahead and made this test case which works for me.

Thus please report back with a reduced test case, that reproduces the issue you are experiencing, on http://jsfiddle.net. So that we can reopen this ticket and investigate the issue further.

Changed March 17, 2011 01:58AM UTC by vmx comment:2

I ran into the same issue, although it isn't a bug, it's not very clear either.

When the dataType is 'json' and your dataFilter returns JSON you will get 'null' back to your success function. When you return a string, it will be parsed and passed on to the success function.

So when you want to have the result of the dataFilter function passed on as is, then you need to set the dataType to 'text'.

Here are examples on jsFiddle:

Changed May 04, 2011 12:22PM UTC by atodorov@infragistics.com comment:3

I don't agree this is a low priority bug. This is a breaking change compared to the previous jQuery versions. when dataFilter is passed as string, and returns a parsed JSON object, it should just return it "as is", instead of returning null.

Angel

Changed May 05, 2011 11:13PM UTC by dmethvin comment:4

See explanation in #9095.