Changeset 4123
- Timestamp:
- 12/12/07 20:54:44 (1 year ago)
- Location:
- trunk/jquery
- Files:
-
- 2 modified
-
src/ajax.js (modified) (1 diff)
-
test/unit/ajax.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/ajax.js
r4106 r4123 220 220 // If we're requesting a remote document 221 221 // and trying to load JSON or Script with a GET 222 if ( !s.url.indexOf("http") && ( s.dataType == "script" || s.dataType =="json" ) && s.type.toLowerCase() == "get" ) {222 if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && ( s.dataType == "script" || s.dataType =="json" ) && s.type.toLowerCase() == "get" ) { 223 223 var head = document.getElementsByTagName("head")[0]; 224 224 var script = document.createElement("script"); -
trunk/jquery/test/unit/ajax.js
r4106 r4123 373 373 expect(2); 374 374 stop(); 375 window.foobar = null; 375 376 $.getScript(url("data/test.js"), function() { 376 377 equals( foobar, "bar", 'Check if script was evaluated' ); … … 564 565 stop(); 565 566 567 window.foobar = null; 566 568 $.ajax({ 567 569 url: base + "data/test.js", … … 581 583 stop(); 582 584 585 window.foobar = null; 583 586 $.ajax({ 584 587 url: base + "data/test.js", … … 588 591 ok( foobar, "Script results returned (GET, no callback)" ); 589 592 equals( status, "success", "Script results returned (GET, no callback)" ); 593 start(); 594 } 595 }); 596 }); 597 598 test("$.ajax() - script, Remote with scheme-less URL", function() { 599 expect(2); 600 601 var base = window.location.href.replace(/\?.*$/, ""); 602 base = base.replace(/^.*?\/\//, "//"); 603 604 stop(); 605 606 window.foobar = null; 607 $.ajax({ 608 url: base + "data/test.js", 609 dataType: "script", 610 success: function(data){ 611 ok( foobar, "Script results returned (GET, no callback)" ); 590 612 start(); 591 613 }
