aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax.js
Commit message (Collapse)AuthorAgeFilesLines
* Makes prefilters and transport inspection more robust and uses better ↵jaubourg2011-01-241-19/+23
| | | | variable names for readability.
* Revised internal implementation of ajaxPrefilter() and ajaxTransport(). ↵jaubourg2011-01-231-103/+80
| | | | Everything is shorter and more efficient now. Also fixes a couple spacing issues that remained.
* More code style fixes.jaubourg2011-01-231-7/+7
|
* Apply JQuery Core Style Guidelines to ajax.js and ajax/*.js,jaubourg2011-01-231-121/+117
|
* Re-organizes ajax.js: prefilters and transports are no longer stored in ↵jaubourg2011-01-221-314/+261
| | | | ajaxSettings (their structure is not handled correctly by extend() and was causing some overhead when constructing the final options map in ajax()); base function for ajaxPrefilter and ajaxTransport has been renamed and split in two (one for inspection, one for addition); response/dataType determination and data conversion logics have been externalized from the ajax() internal callback; data conversion no longer sets responseXXX fields; some minor re-formatting and simplifications.
* Replaces "text in-between" technique with a full-fledged one-level ↵jaubourg2011-01-211-40/+65
| | | | transitive search for converters (unit tests added). Also cleans up auto dataType determination and adds converter checks in order to guess the best dataType possible.
* Moves determineResponse logic into main ajax callback. Puts responseXXX ↵jaubourg2011-01-201-76/+72
| | | | fields definitions into ajaxSettings.
* Renames Deferred's fire and fireReject methods as resolveWith and rejectWith ↵jaubourg2011-01-201-3/+3
| | | | respectively.
* Renames determineDataType as determineResponse. Makes it more generic as a ↵jaubourg2011-01-201-16/+15
| | | | first step into integrating the logic into the main ajax done callback. Also fixes some comments in ajax/xhr.js.
* Revises the way arguments are handled in ajax.jaubourg2011-01-201-7/+6
|
* Makes sure statusCode callbacks are ordered in the same way success and ↵jaubourg2011-01-201-4/+4
| | | | error callbacks are. Unit tests added.
* Cleans up and simplifies code shared by ajaxPrefilter and ajaxTransport. ↵jaubourg2011-01-201-110/+91
| | | | Removes chainability of ajaxSetup, ajaxPrefilter and ajaxTransport. Also makes sure context is handled properly by ajaxSetup (unit test added).
* Moves things around to make jsLint happier.jaubourg2011-01-191-2/+2
|
* Fixes crossDomain test so that it assumes port to be 80 for http and 443 for ↵jaubourg2011-01-191-2/+4
| | | | https when it is not provided.
* Moves determineDataType into ajaxSettings so that it is accessible to ↵jaubourg2011-01-191-48/+50
| | | | transports without the need for a second argument and so that we can now pass the original options to the transport instead. Also ensures the original options are actually propagated to prefilters (they were not).
* Re-adds hastily removed variable and simplifies statusCode based callbacks ↵jaubourg2011-01-191-15/+16
| | | | handling.
* Use undefined instead of 0 to deference transport for clarity.jaubourg2011-01-191-1/+1
|
* Removes unnecessary test and ensures getResponseHeader returns null if the ↵jaubourg2011-01-191-12/+7
| | | | header does not exist.
* Revised how context is determined and removed unnecessary "parameter as ↵jaubourg2011-01-191-12/+10
| | | | variable" trick.
* Moved ajaxSettings.xhr definition together with support.ajax and ↵jaubourg2011-01-191-32/+0
| | | | support.cors determination into ajax/xhr.js.
* Makes it so a prefilter can change the type of a request.jaubourg2011-01-161-7/+7
|
* Removed internal dataTypes option and added headers & crossDomain options ↵jaubourg2011-01-161-1/+2
| | | | into commented out options of ajaxSettings.
* Fixes #2994. Not finding a transport now fires the error callbacks and ↵jaubourg2011-01-161-65/+77
| | | | doesn't make ajax return false. Had to revise how jsonp and script prefilters & transports work (better separation of concerns). Also took the opportunity to revise jXHR getRequestHeader and abort methods and enabled early transport garbage collection when the request completes.
* Moved jQuery.ajax.prefilter and jQuery.ajax.transport to ↵jaubourg2011-01-131-6/+7
| | | | jQuery.ajaxPrefilter and jQuery.ajaxTransport so that proxying the ajax method doesn't turn into a nightmare. Thanks go to scott_gonzalez and DaveMethvin for pointing out the issue. Also made ajaxSetup return "this" to enable chainable definitions -- jQuery.ajaxSetup(...).ajaxPrefilter(...).ajaxTransport(...).
* Fixes #4964. Adds a statusCode object together with a new statusCode method ↵jaubourg2011-01-131-0/+27
| | | | on the jXHR object (deferred behaviour). They accept a map of statusCode/callback(s). Callbacks are fired when the status code of the response correponds to the key (as a success or an error callback depending on how the request completed). Unit tests added.
* Cleans up statusText handling and simplifies 304 notmodified logic.jaubourg2011-01-131-13/+17
|
* Removes unnecessary variables and adds much needed comments into the data ↵jaubourg2011-01-131-6/+28
| | | | conversion logic in ajax.
* Fixes a regression by calling dataFilter with the second argument set as the ↵jaubourg2011-01-131-1/+1
| | | | dataType.
* Gets rid of a var statement by moving variable declarations up.jaubourg2011-01-131-3/+4
|
* AjaxSetup now uses deep extend internally to accomodate map structured options.jaubourg2011-01-121-1/+1
|
* Fixes 4825. jQuery.fn.load: use the jXHR's Promise interface to get the ↵jaubourg2011-01-111-5/+13
| | | | actual response in case ajaxSettings contains a dataFilter. Unit test added.
* Change embedded regexp to a variable (for #6876).Dave Methvin2011-01-091-2/+3
|
* Make it so prefilters get access to the original settings.jaubourg2011-01-091-1/+1
|
* Fixes #5955. Option crossDomain now forces ajax to consider a request as ↵jaubourg2011-01-091-6/+9
| | | | cross-domain even when it is not. Useful for when servers issue redirects to cross-domain urls. Unit test added.
* Make sure prefilters have been called and transport has been selected before ↵jaubourg2011-01-091-3/+3
| | | | sending any global event (in case the "global" option has been changed).
* Fixes #7465. Reworked the regexp and associated test for cross-domain ↵jaubourg2011-01-091-2/+7
| | | | detection so that it now includes ports. Added cross-domain detection tests for protocol, hostname and port.
* Fixes #7868. ResponseText is now properly propagated for error callbacks.jaubourg2011-01-091-0/+5
|
* Fixes #7881. Setting contentType to false will prevent the Content-Type ↵jaubourg2011-01-091-1/+1
| | | | header from being sent. Unit test added.
* Renamed "complete" to "done" in order to avoid conflicts with jXHR.complete.jaubourg2011-01-061-2/+2
|
* Cleaning up trailing whitespace again.Colin Snover2011-01-051-122/+122
|
* "then" renamed "complete" and new "then" method defined using "complete" and ↵jaubourg2011-01-051-2/+2
| | | | "fail" internally. The API is still symetrical (complete/fail), still promotes AOP but is also now Promise/A compliant. Changed unit tests and ajax module accordingly.
* When serializing text, encode all line breaks as CRLF pairs per the ↵Dave Methvin2010-12-311-2/+2
| | | | application/x-www-form-urlencoded specification. Fixes #6876.
* Revised conversion logic to handle converter equal to true properly.jaubourg2010-12-311-14/+19
|
* Introduced a new promise method on deferreds that returns an immutable ↵jaubourg2010-12-311-3/+4
| | | | object (exposing then, fail, isResolved, isRejected and promise itself only). Remove $.isDeferred and moved logic directly into $.when. Made sure $.when returns a promise by using promise(). Used promise() in ajax code too.
* Renamed several ajaxSettings options. Removed cors test, fixed failing cors ↵jaubourg2010-12-311-11/+11
| | | | test.
* Revised logic in data conversion to account for when dataFilter modifies the ↵jaubourg2010-12-311-2/+2
| | | | dataTypes list.
* Removed re-usability from jXHR object (no more open, send & ↵jaubourg2010-12-311-10/+576
| | | | onreadystatechange support). Streamlined the implementation and put it back into ajax.js (removed xhr.js in the process). Went back to a more simple & direct approach to options handling (keeping much room to further minification-related optimizations). Code is cleaner, smaller & faster. Removed & edited unit tests accordingly. All build files have had xhr.js removed.
* Removed dataCheckers, added true as possible value for dataConverters ↵jaubourg2010-12-311-27/+2
| | | | indicating dataType equivalence (ie. no conversion has to be performed).
* Changed dataConverters key format.unknown2010-12-311-20/+5
|
* Rewrote the data conversion logic in ajax. Should be cleaner and faster.jaubourg2010-12-311-2/+2
|