Commit graph

138 commits

Author SHA1 Message Date
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
John Resig d776dc9d5c Got some XHR tests to run, still some hanging threads (need to investigate). Started moving some Ajax tests away from using PHP (more portable this way). Fixed a number of XHR env bugs. 2007-07-09 03:08:20 +00:00
John Resig 03c623c35f Fixed an issue with JSON data in packed scripts. (Bug #1298) 2007-06-16 22:19:17 +00:00
Jörn Zaefferer 33ee5c317d Minor cleanup 2007-04-25 21:22:04 +00:00
Jörn Zaefferer f63242f068 Fix for #1132 2007-04-18 18:35:34 +00:00
Jörn Zaefferer bfe5f89106 Remove XMLHttpRequest shadowing, instead decide at runtime whether to create an ActiveXObject or the XMLHttpRequest, potentially fixing #963 2007-04-03 21:19:54 +00:00
Jörn Zaefferer 06b89271c1 Added test for #970 2007-03-25 10:55:22 +00:00
Jörn Zaefferer e6ffe02503 Fixed docs for ajax timouet to mention that its in milliseconds 2007-03-25 10:52:40 +00:00
Jörn Zaefferer 98b721d27f Fix for #953, use always GET for $.get 2007-03-17 14:18:06 +00:00
Jörn Zaefferer a4a6dfa6bd Backported wiki changes from http://docs.jquery.com/API/1.1.1/Ajax 2007-02-27 21:49:54 +00:00
Jörn Zaefferer fade976946 Fix for #991 2007-02-22 20:37:37 +00:00
Brandon Aaron ef1bd04532 Rolling back fix for #914 due to firefox double evaling scripts 2007-02-17 20:34:15 +00:00
Brandon Aaron 08ff26927b Fix for #914. 2007-02-07 15:20:30 +00:00