Commit graph

150 commits

Author SHA1 Message Date
jaubourg 325dcdc2ab Fixes #8054 by reverting feature enhancement 5812 (4920). Regexps no longer searches for %3F in url or data to find jsonp callback placeholders. 2011-01-26 00:55:39 +01:00
jaubourg 5ca8f0617f Reworks how values of parameters passed to error callbacks are determined. Fixes #8050. 2011-01-25 16:08:19 +01:00
jaubourg ee22c8b34b More code style fixes. 2011-01-23 20:46:09 +01:00
jaubourg dd5bf42122 Apply JQuery Core Style Guidelines to ajax.js and ajax/*.js, 2011-01-23 05:51:41 +01:00
jaubourg 3dbd600e19 Moves determineResponse logic into main ajax callback. Puts responseXXX fields definitions into ajaxSettings. 2011-01-20 19:40:51 +01:00
jaubourg 8ad2b31ff6 Removes misleading comment. 2011-01-20 18:50:47 +01:00
jaubourg ef86694ada Renames determineDataType as determineResponse. Makes it more generic as a first step into integrating the logic into the main ajax done callback. Also fixes some comments in ajax/xhr.js. 2011-01-20 17:38:21 +01:00
jaubourg 64e1cdbb95 Cleans up and simplifies code shared by ajaxPrefilter and ajaxTransport. Removes chainability of ajaxSetup, ajaxPrefilter and ajaxTransport. Also makes sure context is handled properly by ajaxSetup (unit test added). 2011-01-20 04:12:15 +01:00
jaubourg 1cecfa1ece Moves determineDataType into ajaxSettings so that it is accessible to 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). 2011-01-19 18:16:29 +01:00
jaubourg 92c3d87a9c Moved ajaxSettings.xhr definition together with support.ajax and support.cors determination into ajax/xhr.js. 2011-01-19 16:55:26 +01:00
jaubourg 158fa822de Setting the jsonp option to false now inhibits any url manipulation regarding the callback. 2011-01-16 05:26:46 +01:00
jaubourg f74b844989 The script prefilter now forces cross-domain requests type to GET. 2011-01-16 05:25:45 +01:00
jaubourg 8ab23aec2c Fixes #2994. Not finding a transport now fires the error callbacks and 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. 2011-01-16 02:57:39 +01:00
jaubourg a8fa5f2ec1 Moved jQuery.ajax.prefilter and jQuery.ajax.transport to 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(...). 2011-01-13 18:33:24 +01:00
jaubourg 57956152d8 Removed xhr pooling since failing cross-domain requests leaves the xhr object in an undefined state in Firefox. Also rewrote comments related to the active xhr list so that they make sense. 2011-01-13 16:58:16 +01:00
jaubourg 667a3b31e6 Reworked script and xhr abort logic to take advantage of the fact jXHR.abort will complete the request itself if not done already. 2011-01-13 02:05:39 +01:00
jaubourg e221d39e98 Script transport now uses ajaxSetup to define script dataType. 2011-01-12 18:54:15 +01:00
jaubourg 0c51e9d55f Fixes #4897. Added ?? as a context-insensitive placeholder for the callback name of a JSONP request. Unit tests provided. 2011-01-12 18:36:00 +01:00
jaubourg 1d1d4fe112 Moved unload abort code so that the event is only bound if the xhr transport is used. Fixes #5280. 2011-01-09 22:20:58 +01:00
jaubourg 8c8bd3bf6a Fixes #5812. =? will be detected even when it has been escaped during data serialization. 2011-01-09 21:48:52 +01:00
jaubourg 62a1a1a8fa Fixes #5803. Reworked jsonp prefilter so that it sets the dataType as jsonp and recognizes requests with originalSettings having jsonp or jsonpCallback to be jsonp. Moved default jsonp option value into ajaxSettings. Attached the transport to "jsonp" which avoids unnecessary testing. Transport factory sets dataType back to json for proper data conversion. 2011-01-09 21:19:27 +01:00
jaubourg d515068ee8 Fixes #7868. ResponseText is now properly propagated for error callbacks. 2011-01-09 04:53:29 +01:00
jaubourg 98c6c4b2b0 Added a simple cache for xhr objects in the xhr transport. 2011-01-09 04:03:00 +01:00
jaubourg c43b078c69 Renamed src/transports to src/ajax (in case we need prefilters in the future and to avoid a separate prefilters directory). 2011-01-06 01:17:31 +01:00
John Resig b4e23b5af0 Reorganzing the jQuery source (first phase). 2007-09-08 12:42:32 +00:00
John Resig 84eb2cffca Forgot to update the $.param() tests. 2007-09-05 17:22:13 +00:00
John Resig ad5539bab3 Re-disabled the Ajax tests in Safari. 2007-09-05 17:09:18 +00:00
John Resig f96bf10415 Integration of Mike Alsup's excellent form serialization code. The benefits are as follows:
- New method: .serializeArray()
This returns an array of name/value pairs representing the contents of a form, or individual input elements.
- Enhancement: .serialize()
The results are correct now (as opposed to the mess from before), and allows you to serializes forms directly (rather than just the input elements).
- Enhancement: .val()
This now returns the correct value when dealing wih selects. Additionally, when dealing with multiple selects, it returns an array of values.

Based upon Mike's code:
http://malsup.com/jquery/form/comp/form.js

and test suite:
http://malsup.com/jquery/form/comp/test.html
2007-09-05 17:06:05 +00:00
John Resig 53dc6afc31 Removed all deprecated functionality for jQuery 1.2. A full list of what was removed can be found here: http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-for-12/ 2007-09-04 02:55:38 +00:00
John Resig 139393fe09 Removed all inline documentation. The current version of all documentation is stored online, on the wiki: http://docs.jquery.com/ 2007-09-04 01:57:35 +00:00
John Resig d5bb0e3179 Re-disabled the ajax tests in Safari 3. 2007-09-03 23:59:31 +00:00
John Resig a5dbcaf675 Added support for:
- Cross Domain getScript
  $.getScript("http://foo.com/script.js");
- JSONP
  $.ajax({ url: "script.js", type: "jsonp" });
  $.getJSON("script.js?callback=?");
- Cross Domain JSONP/getJSON
  $.getJSON("http://foo.com/script.js?callback=?");
- No-cache Ajax Requests
  $.ajax({ url: "test.html", cache: false });
2007-09-03 23:45:14 +00:00
John Resig 0477a6e99e Added a test case for "purple include", fixed a bug. 2007-08-25 03:55:12 +00:00
John Resig 34f1042902 New feature: You can now inject portions of a document via .load(), as opposed to the full thing.
Examples:
- $("#test").load("test.html #something");
- $("#test").load("test.html p.user");

Caveats:
- No scripts are injected when a selector is used.
- The selector is rooted inside the head and body - it's equivalent to doing:
  $("body,head").find(selector)
2007-08-25 03:33:08 +00:00
John Resig 257eaf7ee3 Marked all the appropriate methods as being deprecated for the 1.1.4 release (in preparation for 1.2). 2007-08-24 01:28:07 +00:00
John Resig 4df20c0c1b Brought back a husk method to represent evalScripts. I didn't realize so many plugins relied on it (it's deprecated in this release). 2007-08-24 01:06:23 +00:00
John Resig f948f02680 Tweaked the Ajax test suite for Safari. 2007-08-22 07:10:50 +00:00
John Resig 8c15e852a4 Two quick fixes in relation to #1028. ajaxSetup shouldn't be deep and the boolean arg should be used, not overwritten with 'true'. 2007-08-21 04:46:07 +00:00
John Resig e112e6b04d Make deep .extend() an optional argument - it will go deep if you pass in an boolean as the first argument (fixed bug #1028). 2007-08-21 04:42:31 +00:00
John Resig 2ef4093cf7 Complete overhaul of the Ajax test suite, it's now passing in all browsers. In order to achieve this I had to fix a numbe
r of bugs in the suite itself, along with other random bugs that popped up. The following bugs were resolved along the wa
y: #1236 (.extend() keeps processing when it hits nulls), #1028 (.extend() now works recursively), #1080 ($.get no longer
 overwrites the data parameter), #1210 (Creating script and link tags now work), and #1463 (jQuery.global has been re-too
led to no longer leak memory and slow things down).
2007-08-19 23:37:26 +00:00
John Resig f64eb21fad We were catching exceptions within the success callback of an Ajax request, then causing an error callback to be called (which is incorrect). (Bug #1441) 2007-08-19 00:48:53 +00:00
John Resig 6b0d3bb273 Brought back jQuery.globalEval(), fixing bug #1425. 2007-07-31 02:59:53 +00:00
Sean Catchpole e6c067858e nevermind, I'm dumb. =P 2007-07-26 00:31:48 +00:00
Sean Catchpole 8a80d05a44 Fixed ajax array arguments in $.param 2007-07-26 00:27:56 +00:00
Brandon Aaron b965c98ff1 missing semi-colon 2007-07-21 01:53:38 +00:00
John Resig e20e8e6e3c Added support for parsererror errors from Ajax requests (bug #1145). 2007-07-21 00:52:30 +00:00
John Resig f83211c684 Added a fix to prevent the completion callback from firing multiple times in Firefox on OSX (fixed bug #1406). 2007-07-20 22:21:41 +00:00
John Resig c47f6f8f52 Completely reworked the evalScripts() code, fixing bugs #1332, #975, and #777. 2007-07-20 21:59:52 +00:00
John Resig 78db847ef2 The isTimeout fix from #970 was causing unintended status bugs (fixed). This also includes a fix for errors that occurred during an empty eval in IE (but #1410). 2007-07-20 19:33:44 +00:00
John Resig a40f141f23 Made the error message equal to "timeout", if the request timed out. (Bug #970) 2007-07-20 18:58:22 +00:00