mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Modified tests to show #746
This commit is contained in:
parent
4c66f62a6f
commit
8cbb4a0ae6
@ -1,7 +1,7 @@
|
|||||||
html text<br/>
|
html text<br/>
|
||||||
<script type="text/javascript">/* <![CDATA[ */
|
<script type="text/javascript">/* <![CDATA[ */
|
||||||
testFoo = "foo"; $('#foo').html('foo');
|
testFoo = "foo"; $('#foo').html('foo');
|
||||||
ok( true, "test.html executed" );
|
ok( true, "test.php executed" );
|
||||||
/* ]]> */</script>
|
/* ]]> */</script>
|
||||||
<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script>
|
<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script>
|
||||||
blabla
|
blabla
|
3
build/test/data/test2.php
Normal file
3
build/test/data/test2.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<script type="text/javascript">
|
||||||
|
testFoo = "foo"; $('#foo').html('foo');ok( true, "test2.php executed" );
|
||||||
|
</script>
|
@ -72,17 +72,28 @@ test("load(String, Object, Function) - check scripts", function() {
|
|||||||
foobar = null;
|
foobar = null;
|
||||||
var verifyEvaluation = function() {
|
var verifyEvaluation = function() {
|
||||||
ok( foobar == "bar", 'Check if script src was evaluated after load' );
|
ok( foobar == "bar", 'Check if script src was evaluated after load' );
|
||||||
ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM');
|
|
||||||
ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM');
|
ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM');
|
||||||
start();
|
start();
|
||||||
};
|
};
|
||||||
$('#first').load(url('data/test.php'), function() {
|
$('#first').load(url('data/test.php'), function() {
|
||||||
ok( $('#first').html().match(/^html text/), 'Check content after loading html' );
|
ok( $('#first').html().match(/^html text/), 'Check content after loading html' );
|
||||||
|
ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM');
|
||||||
ok( testFoo == "foo", 'Check if script was evaluated after load' );
|
ok( testFoo == "foo", 'Check if script was evaluated after load' );
|
||||||
setTimeout(verifyEvaluation, 600);
|
setTimeout(verifyEvaluation, 600);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("load(String, Object, Function) - check file with only a script tag", function() {
|
||||||
|
expect(3);
|
||||||
|
stop();
|
||||||
|
testFoo = undefined;
|
||||||
|
$('#first').load(url('data/test2.php'), function() {
|
||||||
|
ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM');
|
||||||
|
ok( testFoo == "foo", 'Check if script was evaluated after load' );
|
||||||
|
start();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test("test global handlers - success", function() {
|
test("test global handlers - success", function() {
|
||||||
expect(8);
|
expect(8);
|
||||||
stop();
|
stop();
|
||||||
|
Loading…
Reference in New Issue
Block a user