mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Tests: Fix failing ajax tests in oldIE
This commit is contained in:
parent
4d5596e3e4
commit
d89c278a33
@ -3,5 +3,5 @@ html text<br/>
|
|||||||
testFoo = "foo"; jQuery('#foo').html('foo');
|
testFoo = "foo"; jQuery('#foo').html('foo');
|
||||||
ok( true, "test.html executed" );
|
ok( true, "test.html executed" );
|
||||||
/* ]]> */</script>
|
/* ]]> */</script>
|
||||||
<script src="data/test.js"></script>
|
<script src="data/testbar.php"></script>
|
||||||
blabla
|
blabla
|
||||||
|
@ -3,5 +3,5 @@ html text<br/>
|
|||||||
testFoo = "foo"; jQuery('#foo').html('foo');
|
testFoo = "foo"; jQuery('#foo').html('foo');
|
||||||
ok( true, "test.php executed" );
|
ok( true, "test.php executed" );
|
||||||
/* ]]> */</script>
|
/* ]]> */</script>
|
||||||
<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script>
|
<script src="data/testbar.php?<?php srand(); echo time() . '' . rand(); ?>"></script>
|
||||||
blabla
|
blabla
|
@ -1,3 +1,3 @@
|
|||||||
this.testBar = "bar";
|
this.testBar = "bar";
|
||||||
jQuery("#ap").html("bar");
|
jQuery("#ap").html("bar");
|
||||||
ok( true, "test.js executed");
|
ok( true, "testbar.php executed");
|
@ -602,7 +602,7 @@ module( "ajax", {
|
|||||||
|
|
||||||
ok( jQuery.get( url(target), success ), "get" );
|
ok( jQuery.get( url(target), success ), "get" );
|
||||||
ok( jQuery.post( url(target), success ), "post" );
|
ok( jQuery.post( url(target), success ), "post" );
|
||||||
ok( jQuery.getScript( url("data/test.js"), success ), "script" );
|
ok( jQuery.getScript( url("data/testbar.php"), success ), "script" );
|
||||||
ok( jQuery.getJSON( url("data/json_obj.js"), success ), "json" );
|
ok( jQuery.getJSON( url("data/json_obj.js"), success ), "json" );
|
||||||
ok( jQuery.ajax({
|
ok( jQuery.ajax({
|
||||||
url: url( target ),
|
url: url( target ),
|
||||||
@ -850,7 +850,7 @@ module( "ajax", {
|
|||||||
setup: function() {
|
setup: function() {
|
||||||
Globals.register("testBar");
|
Globals.register("testBar");
|
||||||
},
|
},
|
||||||
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/test.js",
|
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/testbar.php",
|
||||||
dataType: "script",
|
dataType: "script",
|
||||||
success: function() {
|
success: function() {
|
||||||
strictEqual( window["testBar"], "bar", "Script results returned (GET, no callback)" );
|
strictEqual( window["testBar"], "bar", "Script results returned (GET, no callback)" );
|
||||||
@ -861,7 +861,7 @@ module( "ajax", {
|
|||||||
setup: function() {
|
setup: function() {
|
||||||
Globals.register("testBar");
|
Globals.register("testBar");
|
||||||
},
|
},
|
||||||
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/test.js",
|
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/testbar.php",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "script",
|
dataType: "script",
|
||||||
success: function( data, status ) {
|
success: function( data, status ) {
|
||||||
@ -874,7 +874,7 @@ module( "ajax", {
|
|||||||
setup: function() {
|
setup: function() {
|
||||||
Globals.register("testBar");
|
Globals.register("testBar");
|
||||||
},
|
},
|
||||||
url: window.location.href.replace( /[^\/]*$/, "" ).replace( /^.*?\/\//, "//" ) + "data/test.js",
|
url: window.location.href.replace( /[^\/]*$/, "" ).replace( /^.*?\/\//, "//" ) + "data/testbar.php",
|
||||||
dataType: "script",
|
dataType: "script",
|
||||||
success: function() {
|
success: function() {
|
||||||
strictEqual( window["testBar"], "bar", "Script results returned (GET, no callback)" );
|
strictEqual( window["testBar"], "bar", "Script results returned (GET, no callback)" );
|
||||||
@ -1776,7 +1776,7 @@ module( "ajax", {
|
|||||||
|
|
||||||
asyncTest( "jQuery.getScript( String, Function ) - with callback", 2, function() {
|
asyncTest( "jQuery.getScript( String, Function ) - with callback", 2, function() {
|
||||||
Globals.register("testBar");
|
Globals.register("testBar");
|
||||||
jQuery.getScript( url("data/test.js"), function() {
|
jQuery.getScript( url("data/testbar.php"), function() {
|
||||||
strictEqual( window["testBar"], "bar", "Check if script was evaluated" );
|
strictEqual( window["testBar"], "bar", "Check if script was evaluated" );
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
@ -1784,12 +1784,12 @@ module( "ajax", {
|
|||||||
|
|
||||||
asyncTest( "jQuery.getScript( String, Function ) - no callback", 1, function() {
|
asyncTest( "jQuery.getScript( String, Function ) - no callback", 1, function() {
|
||||||
Globals.register("testBar");
|
Globals.register("testBar");
|
||||||
jQuery.getScript( url("data/test.js") ).done( start );
|
jQuery.getScript( url("data/testbar.php") ).done( start );
|
||||||
});
|
});
|
||||||
|
|
||||||
asyncTest( "#8082 - jQuery.getScript( String, Function ) - source as responseText", 2, function() {
|
asyncTest( "#8082 - jQuery.getScript( String, Function ) - source as responseText", 2, function() {
|
||||||
Globals.register("testBar");
|
Globals.register("testBar");
|
||||||
jQuery.getScript( url("data/test.js"), function( data, _, jqXHR ) {
|
jQuery.getScript( url("data/testbar.php"), function( data, _, jqXHR ) {
|
||||||
strictEqual( data, jqXHR.responseText, "Same-domain script requests returns the source of the script" );
|
strictEqual( data, jqXHR.responseText, "Same-domain script requests returns the source of the script" );
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
@ -2017,7 +2017,9 @@ module( "ajax", {
|
|||||||
strictEqual( data, "test%5Blength%5D=7&test%5Bfoo%5D=bar", "Check if a sub-object with a length param is serialized correctly" );
|
strictEqual( data, "test%5Blength%5D=7&test%5Bfoo%5D=bar", "Check if a sub-object with a length param is serialized correctly" );
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
).always( start );
|
).always(function() {
|
||||||
|
start();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
asyncTest( "jQuery.post( String, Hash, Function ) - simple with xml", 4, function() {
|
asyncTest( "jQuery.post( String, Hash, Function ) - simple with xml", 4, function() {
|
||||||
@ -2040,7 +2042,9 @@ module( "ajax", {
|
|||||||
strictEqual( jQuery( "result", this ).text(), "3", "Check for XML" );
|
strictEqual( jQuery( "result", this ).text(), "3", "Check for XML" );
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
).always( start );
|
).always(function() {
|
||||||
|
start();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//----------- jQuery.active
|
//----------- jQuery.active
|
||||||
|
@ -2348,7 +2348,7 @@ test( "script evaluation (#11795)", function() {
|
|||||||
|
|
||||||
if ( jQuery.ajax ) {
|
if ( jQuery.ajax ) {
|
||||||
Globals.register("testBar");
|
Globals.register("testBar");
|
||||||
jQuery("#qunit-fixture").append( "<script src='" + url("data/test.js") + "'/>" );
|
jQuery("#qunit-fixture").append( "<script src='" + url("data/testbar.php") + "'/>" );
|
||||||
strictEqual( window["testBar"], "bar", "Global script evaluation" );
|
strictEqual( window["testBar"], "bar", "Global script evaluation" );
|
||||||
} else {
|
} else {
|
||||||
ok( true, "No jQuery.ajax" );
|
ok( true, "No jQuery.ajax" );
|
||||||
|
Loading…
Reference in New Issue
Block a user