Skip to main content

Bug Tracker

Side navigation

#7171 closed feature (fixed)

Opened October 13, 2010 06:05AM UTC

Closed January 31, 2011 02:21PM UTC

dataType plugins for $.ajax()

Reported by: eris.discord@gmail.com Owned by: kswedberg
Priority: low Milestone: 1.5
Component: ajax Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

This would be useful: dataType plugins for $.ajax() et al.

Plugins could register themselves to be placed between the ajax call and the success callback so that we could say, for instance,

$.ajax({ dataType: 'yaml', … })

and automatically be given an object. The plugin might be a simple function that accepts the response text and returns whatever is appropriate.

Perhaps a more advanced plugin could specify that it wants the response to be passed to it as XML, what response mime types it accepts, etc. For instance,

$.ajax({ dataType: 'plist', … })

might pass an XML Property List to the plugin, which would return an object deserialized from from it.

Attachments (0)
Change History (5)

Changed October 13, 2010 07:10PM UTC by snover comment:1

component: unfiledajax
milestone: 1.4.3
priority: undecidedlow
status: newopen

Changed December 27, 2010 10:37PM UTC by rwaldron comment:2

keywords: → ajaxrewrite

Changed January 11, 2011 10:13PM UTC by jaubourg comment:3

keywords: ajaxrewriteajaxrewrite needsdocs

The new ajax architecture is pluggable and is designed to allow custom dataTypes. Documentation is needed but it's there.

Changed January 15, 2011 11:52PM UTC by jaubourg comment:4

owner: → kswedberg
status: openassigned

Re-assigning to Karl. We're working on the doc these days.

Changed January 31, 2011 02:21PM UTC by jitter comment:5

keywords: ajaxrewrite needsdocs
milestone: → 1.5
resolution: → fixed
status: assignedclosed
version: 1.4.21.4.4

With 1.5 and the new ajax rewrite you can easily add custom dataType handling code. Check http://api.jquery.com/extending-ajax/ for more info