Commit Graph

191 Commits

Author SHA1 Message Date
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
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
Jörn Zaefferer
1e07c1a311 Fix for #884 2007-01-31 21:14:33 +00:00
John Resig
c39d1a21c6 Fixed doing $.post() without any params. 2007-01-22 03:49:04 +00:00
John Resig
27c08b6544 Added a fix for an undefined param being passed to a load. 2007-01-20 04:04:02 +00:00
Jörn Zaefferer
32f688d303 Simplified check for XMLHttpRequest (saving a few bytes) and fixed load()-test 2007-01-17 14:17:09 +00:00
Mike Alsup
5ebd5f604a Fix bug #814. 2007-01-16 11:38:33 +00:00
Jörn Zaefferer
8ac2169dc0 Fixed two FF JS warnings 2007-01-14 22:51:55 +00:00
John Resig
34355cd698 Converted a lot of for loops to use jQuery.each() instead. 2007-01-14 21:49:59 +00:00
John Resig
2591319660 Added back in the .load() fix. 2007-01-14 20:07:36 +00:00
John Resig
382a7ecd6d Merged in some wiki fixes into the main docs. 2007-01-14 19:49:58 +00:00
John Resig
ed5bda3020 Added in jQuery.isFunction(). 2007-01-14 06:22:20 +00:00
John Resig
2bd21fe3b3 Touched up the code a little bit, saving some bytes. 2007-01-14 06:02:56 +00:00
John Resig
c690472135 Added a fix for <script>s getting executed twice when .load()ed. 2007-01-10 21:31:18 +00:00
John Resig
12e6335339 Fixed a bug with $("body") in dynamic documents, refactored $(...), stopped the test suite from trying to run Ajax tests locally. 2007-01-08 00:12:41 +00:00
Mike Alsup
386c0bc8a6 Updated param method to encode name as well as value (per spec: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1) 2007-01-07 20:56:17 +00:00
John Resig
d7b73ea5c7 Improved the categories of a bunch of docs, upped the version to 1.1. 2007-01-07 09:20:19 +00:00
John Resig
ab0287681f Cleaned up some spacing and braces. 2007-01-06 06:18:02 +00:00
John Resig
c330527318 Converted instances of new function(){ ... } to use jQuery.each(...) instead. Also, removed unnecessary documentation for trigger functions (.mouseup()!?). 2007-01-06 05:31:47 +00:00
Jörn Zaefferer
2daf49296a Changed "Hash" to "Map" in docs 2007-01-04 10:03:34 +00:00
Mike Alsup
9c073265de added evalScripts test 2007-01-02 12:39:13 +00:00
Jörn Zaefferer
ee636689f4 Added note for IE's behaviour of stripping script tags when there are no chracters in front of it (see #746) 2007-01-01 15:26:24 +00:00
Jörn Zaefferer
8cbb4a0ae6 Modified tests to show #746 2006-12-31 15:44:59 +00:00
Jörn Zaefferer
4c66f62a6f Improved Mikes hack to ease testing against IE cache 2006-12-31 15:09:07 +00:00
Mike Alsup
1267e79699 add time to test.html request url using new Date().getTime() 2006-12-31 02:00:33 +00:00
Jörn Zaefferer
666cc90064 Fix for #534 2006-12-29 13:49:28 +00:00
Jörn Zaefferer
bfdf836da9 Documentation for $.ajaxSetup 2006-12-22 14:40:46 +00:00
Jörn Zaefferer
fc84b9db10 Implemented global ajax settings - no documentation yet 2006-12-22 13:56:36 +00:00
Jörn Zaefferer
ccc4c7663a Fixed typo 2006-12-21 18:37:24 +00:00
Jörn Zaefferer
98b1b580c7 A few corrections to the testsuite to imrove the failure testing 2006-12-21 15:23:59 +00:00
Jörn Zaefferer
a0d5e89a1e Added note to load() to avoid using it to load scripts (#456) 2006-12-21 13:39:14 +00:00
Jörn Zaefferer
6b8ffe79f4 Implemented a better error handling for ajax requests. Exceptions caused by dropping connections are now handled, too. 2006-12-21 13:35:32 +00:00
Jörn Zaefferer
0f5292b991 Added test for sync requests with callbacks (#534) 2006-12-21 12:57:22 +00:00
Jörn Zaefferer
2abdbd4e30 Fixed wheather-whether typo - Thanks Erik 2006-12-20 11:25:15 +00:00
Jörn Zaefferer
898ca3198b Fixed synchrnous requests, improved AJAX inline documentation 2006-12-15 09:13:24 +00:00
Jörn Zaefferer
3e165ae5ab Fixed docs for $.ajax' processData option 2006-12-13 19:04:36 +00:00
Jörn Zaefferer
010a112e04 Fixed #471 2006-12-11 08:53:33 +00:00
Jörn Zaefferer
f1c91fd023 Renamed $.ajax's "before"-option to "beforeSend" to prevent conflict with form plugin - may be a good convention to use beforeXXX and afterXXX everytime for callbacks... 2006-12-05 22:58:27 +00:00
Jörn Zaefferer
2bdd208e41 Renamed preprocess to before, for consistency with form plugin 2006-12-04 19:40:25 +00:00
Jörn Zaefferer
a6ce303187 Simplified XMLHttpRequest shadow (tested on 5.5, 6 and 7); Introduced preprocess callback (#384) - IE seems to fail to send the correct headers 2006-12-04 19:37:49 +00:00
Jörn Zaefferer
39c05d3649 Fixed jQuery.eval (or rather, jQuery.globalEval to avoid problems with FF) 2006-12-02 13:43:02 +00:00
Jörn Zaefferer
dc6f9cfc9c Fixed serializing arrays (bug #448) 2006-11-30 20:52:24 +00:00
Jörn Zaefferer
fea94528e2 Fixed docs for $.ajax for data option 2006-11-28 11:36:54 +00:00
Jörn Zaefferer
ae58d24fd5 Another attempt to fix the getScript problem 2006-11-21 09:55:34 +00:00
Jörn Zaefferer
953bf593a6 Fixed typo in comment 2006-11-21 09:21:38 +00:00
Jörn Zaefferer
15a30ba90c Better fix for #407 issue 2006-11-21 09:14:29 +00:00
Jörn Zaefferer
46faa03820 Fix for bug #407, yet to be tested 2006-11-20 20:37:28 +00:00
Jörn Zaefferer
7cc550727c Testsuite 2.0 2006-11-18 13:37:01 +00:00
Jörn Zaefferer
797ccbaf31 Heavily improved documentation for $.ajax, but may still need some fixes 2006-11-18 10:37:33 +00:00