下面是一个例子:为什么不能在IE上使用?
http://develop.davzy.com/ajaxtest/#!/contents
它适用于所有浏览器,除了IE浏览器。下面的代码:
<!doctype html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script>
$(document).ready(function(){
$('div').load('contents.html');
});
</script>
</head>
<body>
<div>This message will change if the call is made correctly.</div>
</body>
</html>
contents.html的内容 如果你仍然在test.html文件,那么这个AJAX调用工作。
显然我打算使用hashtag导航,但奇怪的是,如果您从网址中删除/#!/内容,它将在IE中工作。但是如果你把它留在那里,即使它与代码无关,它仍然不起作用。看着头部我得到了406错误。帮助:(
http://develop.davzy.com/contents.html doesnt exist?也许你已经在Firefox中使用了HTML? – papachan
它从不尝试获取该页面。它试图得到http://develop.davzy.com/ajaxtest/contents.html,它是一个406错误,而不是404 –
确定它对我来说工作正常。在IE 9上。 – papachan