Opened 12 years ago
Closed 12 years ago
#7171 closed feature (fixed)
dataType plugins for $.ajax()
Reported by: | 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.
Change History (5)
comment:1 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Milestone: | 1.4.3 |
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 12 years ago by
Keywords: | ajaxrewrite added |
---|
comment:3 Changed 12 years ago by
Keywords: | needsdocs added |
---|
comment:4 Changed 12 years ago by
Owner: | set to kswedberg |
---|---|
Status: | open → assigned |
Re-assigning to Karl. We're working on the doc these days.
comment:5 Changed 12 years ago by
Keywords: | ajaxrewrite needsdocs removed |
---|---|
Milestone: | → 1.5 |
Resolution: | → fixed |
Status: | assigned → closed |
Version: | 1.4.2 → 1.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
The new ajax architecture is pluggable and is designed to allow custom dataTypes. Documentation is needed but it's there.