javascript in ie9 dans page asp.net
Bonjour,
dans une page asp.net, je veux creer loading image avec javascript.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<script type="text/javascript">
/* <![CDATA[ */
this.focus(); //focus on new window
redirect = function() {
var querystring = window.location.search.substring(1); //query string
var page = querystring.substring(querystring.indexOf('=') + 1, querystring.length);
function toPage() {
if (page !== undefined && page.length > 1) {
document.write('<!--[if !IE]>--> <head><meta http-equiv="REFRESH" content="1;url=' + page + '" /><\/head><!--<![endif]-->');
document.write(' \n <!--[if IE]>');
document.write(' \n <script type="text/javascript">');
document.write(' \n var version = parseInt(navigator.appVersion);');
document.write(' \n if (version>=4 || window.location.replace) {');
document.write(' \n window.location.replace("' + page + '");');
document.write(' document.images["imgAjax"].src = ""../images/loading.gif"');
document.write(' \n } else');
document.write(' \n window.location.href="' + page + '";');
document.write(' \n <\/script> <![endif]-->');
}
}
return {
begin: toPage
}
} ();
redirect.begin();
/* ]]> */
</script> |
ce code marche tres bien dans ie6, ie7, ie8, chrome et firefox.
pourquoi ça marche pas dans ie9 ??
l'image s'affiche, mais le redirect ça marche pas.