aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDavid Serduke <davidserduke@gmail.com>2008-01-17 21:38:58 +0000
committerDavid Serduke <davidserduke@gmail.com>2008-01-17 21:38:58 +0000
commit0635df43914eec10e4b468ddb2f952f5024c644e (patch)
tree8709a47b5ded325de9b0381ed9e3b32930068686 /test/unit
parentdcb46c7fe572923b02b575477ab02af797ab392a (diff)
downloadjquery-0635df43914eec10e4b468ddb2f952f5024c644e.tar.gz
jquery-0635df43914eec10e4b468ddb2f952f5024c644e.zip
Fixed #2174 by removing the s.dataType == "json" check for possible cross domain since it causes absolute urls to use a <script> tag ajax retrieval even though absolute urls work fine for retrieving local data. Cross-domain jsonp will still work since the $.ajax() function actually changes the s.dataType to "script" before it reaches this check in cases where it is s.dataType == "jsonp" or s.dataType == "json" and a parameter has =? in it.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/ajax.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 8dcf7591e..15c4ed744 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -649,15 +649,15 @@ test("$.getJSON(String, Function) - JSON object", function() {
});
});
-test("$.getJSON(String, Function) - Remote JSON object with assignment", function() {
+test("$.getJSON(String, Function) - JSON object with absolute url to local content", function() {
expect(2);
var base = window.location.href.replace(/\?.*$/, "");
stop();
- $.getJSON(base + "data/json_assigned_obj.js", function() {
- ok( typeof json_assigned_obj == "object", 'Check JSON loaded' );
- equals( json_assigned_obj.test, "worked", 'Check JSON obj.test' );
+ $.getJSON(url(base + "data/json.php"), function(json) {
+ ok( json.data.lang == 'en', 'Check JSON: lang' );
+ ok( json.data.length == 25, 'Check JSON: length' );
start();
});
});