Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7171 closed feature (fixed)

dataType plugins for $.ajax()

Reported by: [email protected] Owned by: kswedberg
Priority: low Milestone: 1.5
Component: ajax Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


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.

Change History (5)

comment:1 Changed 12 years ago by snover

Component: unfiledajax
Milestone: 1.4.3
Priority: undecidedlow
Status: newopen

comment:2 Changed 12 years ago by Rick Waldron

Keywords: ajaxrewrite added

comment:3 Changed 12 years ago by jaubourg

Keywords: needsdocs added

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

comment:4 Changed 12 years ago by jaubourg

Owner: set to kswedberg
Status: openassigned

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

comment:5 Changed 12 years ago by jitter

Keywords: ajaxrewrite needsdocs removed
Milestone: 1.5
Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.