diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2006-12-31 15:09:07 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2006-12-31 15:09:07 +0000 |
commit | 4c66f62a6fcc84a6c85249d0fb34b93edd40be00 (patch) | |
tree | e3896ed5627eb7958aa3b5ddab290a70cfd86b46 /build | |
parent | c3d8cb0c09c2d7d5f0fc3a78f8b4cef9b0adc640 (diff) | |
download | jquery-4c66f62a6fcc84a6c85249d0fb34b93edd40be00.tar.gz jquery-4c66f62a6fcc84a6c85249d0fb34b93edd40be00.zip |
Improved Mikes hack to ease testing against IE cache
Diffstat (limited to 'build')
-rw-r--r-- | build/test/data/test.php (renamed from build/test/data/test.html) | 2 | ||||
-rw-r--r-- | build/test/data/testrunner.js | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/build/test/data/test.html b/build/test/data/test.php index df438d01d..fa36432f8 100644 --- a/build/test/data/test.html +++ b/build/test/data/test.php @@ -3,5 +3,5 @@ html text<br/> testFoo = "foo"; $('#foo').html('foo'); ok( true, "test.html executed" ); /* ]]> */</script> -<script src="data/test.js"></script> +<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script> blabla
\ No newline at end of file diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index 6da41c3a2..0ff0ad500 100644 --- a/build/test/data/testrunner.js +++ b/build/test/data/testrunner.js @@ -191,4 +191,17 @@ function t(a,b,c) { for ( var i = 0; i < f.length; i++ ) s += (s && ",") + '"' + f[i].id + '"'; isSet(f, q.apply(q,c), a + " (" + b + ")"); +} + +/** + * Add random number to url to stop IE from caching + * + * @example url("data/test.html") + * @result "data/test.html?10538358428943" + * + * @example url("data/test.php?foo=bar") + * @result "data/test.php?foo=bar&10538358345554" + */ +function url(value) { + return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); }
\ No newline at end of file |