Кто-нибудь знает, почему window.location не определен в ie8 (может быть, и ie7 тоже), но работает как document.location?
Я не мог найти, почему другой файл из другого проекта имеет похожий код, но не имеет проблем с IE.
Я тоже получаю странную ошибку: 'window.location.hash является нулем или не является объектом в jquery 1.6.4 строка 2'. Я тоже пробовал 1.5.1, но та же ошибка.
Заголовок:
<html lang="">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="assets/css/style.css">
<script src="assets/js/jquery.1.6.4.min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="assets/js/jquery.easing.1.3.js"></script>
<script src="assets/js/jquery.ba-hashchange.min.js"></script>
<script src="assets/js/script.js"></script>
</head>
JS часть:
if( window.onhashchange )
{
window.onhashchange = function()
{
hashChanged( window.location.hash );
}
}
else
{
var storedHash = window.location.hash;
window.setInterval( function()
{
if( window.location.hash != storedHash )
{
storedHash = window.location.hash;
hashChanged( storedHash );
}
}, 100 );
}