diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2006-12-15 09:13:24 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2006-12-15 09:13:24 +0000 |
commit | 898ca3198b3297f68eb77ad128450ad8f952e15e (patch) | |
tree | 15a2ef3d9ed74c97047eca692d2fd26e5313f1bf /src/ajax/ajaxTest.js | |
parent | 18e330741f7e80aaa38ca700ab8a5884d6e671eb (diff) | |
download | jquery-898ca3198b3297f68eb77ad128450ad8f952e15e.tar.gz jquery-898ca3198b3297f68eb77ad128450ad8f952e15e.zip |
Fixed synchrnous requests, improved AJAX inline documentation
Diffstat (limited to 'src/ajax/ajaxTest.js')
-rw-r--r-- | src/ajax/ajaxTest.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ajax/ajaxTest.js b/src/ajax/ajaxTest.js index 48010a255..ad705a10c 100644 --- a/src/ajax/ajaxTest.js +++ b/src/ajax/ajaxTest.js @@ -22,6 +22,27 @@ test("param", function() { ok( $.param(params) == "foo[bar]=baz&foo[beep]=42&foo[quux]=All%20your%20base%20are%20belong%20to%20us", "even more arrays" ); }); +test("pass-through request object", function() { + expect(7); + stop(); + var count = 0; + var success = function() { + if(count++ == 6) + start(); + } + var url = "data/name.php"; + ok( $.get(url, success), "get" ); + ok( $.getIfModified(url, success), "getIfModified" ); + ok( $.post(url, success), "post" ); + ok( $.getScript("data/test.js", success), "script" ); + ok( $.getJSON("data/json.php", success), "json" ); + ok( $.ajax({url: url, success: success}), "generic" ); +}); + +test("synchronous request", function() { + ok( /^{ "data"/.test( $.ajax({url: "data/json.php", async: false}).responseText ), "check returned text" ); +}); + test("load(String, Object, Function) - simple: inject text into DOM", function() { expect(2); stop(); |