![](/img/trans.png)
[英]$(window).bind('hashchange', function () — advice needed
[英]$(window).bind('hashchange', function () is not working in my IE9
我的网站使用$(window).bind('hashchange', function ())
来检查是否需要重定向。 但是,我的网站在Firefox中无法在IE9中正常工作
$(window).bind('hashchange', function ()
{
alert('hash change2');
hash();
});
$(window).load(function()
{
// Make sure cookies are enabled
$.cookie(global_cookie_prefix+'_cookies_test', '1');
var test_cookies_cookie = $.cookie(global_cookie_prefix+'_cookies_test');
if(test_cookies_cookie == null)
{
window.location.replace('error.php?error_code=3');
}
else
{
$.cookie(global_cookie_prefix+'_cookies_test', null);
hash();
/*
alert('after hash0');
$(window).bind('hashchange', function ()
{
//alert('hash change');
//alert('hash change1');
hash();
});
*/
}
});
每次我需要刷新整个页面以使页面成功重定向。
拜托,有什么主意吗?
/ *! jQuery v1.7.1 jquery.com | jquery.org/license * /
我设法找到解决方案。 在doctype html上添加了一行,然后一切正常
<meta http-equiv="X-UA-Compatible" content="IE-edge">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.