Ke.*_*Ke. 21 javascript methods jquery internet-explorer
我有以下代码,它在除了IE之外的所有东西(像往常一样)工作.它让我在Jquery中意外调用方法或属性访问,我不知道如何调试它.我一直在使用IE开发人员工具栏,这对于这个错误没用,只给了我一行12号(在jquery脚本里面).
非常感谢任何帮助:
<script type="text/javascript">
$(document).ready(function () {
$.history.init(pageload);
$('a[href=' + window.location.hash + ']').addClass('selected');
$('a[rel=ajax]').click(function () {
var hash = this.href;
hash = hash.replace(/^.*#/, '');
$.history.load(hash);
$('a[rel=ajax]').removeClass('selected');
$(this).addClass('selected');
$('.loading').show();
getPage();
return false;
});
});
function pageload(hash) {
if (hash) getPage();
}
function getPage() {
hash = document.location.hash;
hash = hash.replace(/^.*#/, '');
var data = 'page=' + encodeURIComponent(hash);
$.ajax({
url: "index.php",
type: "POST",
data: data,
cache: false,
success: function (html) {
$('.loading').hide();
$('tbody').html(html);
}
});
}
</script>
Run Code Online (Sandbox Code Playgroud)
这是历史插件:http://plugins.jquery.com/project/history
以下是我一直关注的演示:http: //plugins.jquery.com/project/history
仍然将window.location改回document.location似乎没有什么区别
我迷失在这一个.当我更改标签时,我正在调用它确实发布,所以它正在工作,但在IE中,设计全部被破坏,我点击的下一个链接不发布.真奇怪!! 在firefox,opera等中运行良好.