Changeset 4476
- Timestamp:
- 01/17/08 21:38:58 (7 months ago)
- Location:
- trunk/jquery
- Files:
-
- 2 modified
-
src/ajax.js (modified) (1 diff)
-
test/unit/ajax.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/ajax.js
r4446 r4476 233 233 // If we're requesting a remote document 234 234 // and trying to load JSON or Script with a GET 235 if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && ( s.dataType == "script" || s.dataType =="json" )&& s.type.toLowerCase() == "get" ) {235 if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && s.dataType == "script" && s.type.toLowerCase() == "get" ) { 236 236 var head = document.getElementsByTagName("head")[0]; 237 237 var script = document.createElement("script"); -
trunk/jquery/test/unit/ajax.js
r4192 r4476 650 650 }); 651 651 652 test("$.getJSON(String, Function) - Remote JSON object with assignment", function() {652 test("$.getJSON(String, Function) - JSON object with absolute url to local content", function() { 653 653 expect(2); 654 654 … … 656 656 657 657 stop(); 658 $.getJSON( base + "data/json_assigned_obj.js", function() {659 ok( typeof json_assigned_obj == "object", 'Check JSON loaded' );660 equals( json_assigned_obj.test, "worked", 'Check JSON obj.test' );658 $.getJSON(url(base + "data/json.php"), function(json) { 659 ok( json.data.lang == 'en', 'Check JSON: lang' ); 660 ok( json.data.length == 25, 'Check JSON: length' ); 661 661 start(); 662 662 });