jquery / jquery/api.jquery.com
Custom content-type converters in .ajaxSetup() also needs a "contents" map entry
Open
Nobody has claimed this yet.
help wanted
- Dominant language
- HTML
- Stars
- 325
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
$.ajaxSetup({
converters: {
"mycustomtype json": function (result) {
//do stuff
return newresult;
}
}
});
was not working. The solution needed was:
$.ajaxSetup({
contents: {
mycustomtype: /mycustomtype/
},
converters: {
"mycustomtype json": function (result) {
//do stuff
return newresult;
}
}
});
which simply included a contents regex map. Please see http://bugs.jquery.com/ticket/11376 for more information, and ping @addyosmani to see if he's attempted documenting this yet.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the jQuery ajaxSetup documentation and the linked ticket 11376. Document that custom content-type converters also require a matching contents regex map, using the example from the issue; done means the relationship between contents and converters is clear to readers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jquery
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100