jstree链接在IE8中不工作
jstree link are not working in IE8
我使用以下代码:
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://static.jstree.com/3.1.1/assets/dist/themes/default/style.min.css">
</head>
<body>
<h1>HTML demo</h1>
<div id="tree" class="demo">
<ul>
<li><a href="http://www.google.com">Google</a>
<ul>
<li><a href="https://mail.google.com">Gmail</a></li>
</ul>
</li>
<li><a href="http://www.yahoo.com">yahoo</a>
<ul>
<li><a href="https://mail.yahoo.com/">yahoo mail</a></li>
</ul>
</li>
</ul>
</div>
<script src="http://static.jstree.com/3.1.1/assets/dist/libs/jquery.js"></script>
<script src="http://static.jstree.com/3.1.1/assets/dist/jstree.min.js"></script>
<script>
$("#tree").jstree({
"plugins": ["core", "themes", "html_data", "search"]
}).on("select_node.jstree", function(e, data) {
document.location = data.instance.get_node(data.node, true).children('a').attr('href');
});
</script>
</body>
</html>
我想在链接到jtree的节点时否定其他页面。此代码在最新版本中运行良好,但在IE8中不起作用。我该怎么做才能使它正常工作?
请在服务器上运行,当你在IE8上尝试时,你会发现问题所在。
尝试使用window.location
代替document.location
,因为后者在IE中是只读的:
https://developer.mozilla.org/en-US/docs/Web/API/Document/location
相关文章:
- IE8更改文本区域上的事件侦听器不工作
- window.onbeforeunload在IE8中不触发(在Firefox,Chrome和Safari中工作正常)
- $('body').on('blur')在IE8中工作不好
- window.location重定向没有'我不在IE8上工作
- addEventListener没有'不能在IE中工作(在IE8中测试)
- Requirejs和主干应用程序,不能在IE8中工作
- 无法在 IE 9 中传递此运算符的值,而它在 IE7 和 IE8 中工作正常
- Request.UrlReferrer在IE8中无法正常工作,并且工作正常IE9
- 不触发 OnClick 事件 IE8,但在 Firefox 中工作正常
- 如何优化我的jQuery以始终在IE8中工作,目前它被击中和错过
- 获取尾随逗号(在JavaScript中)在IE7 / IE8中工作
- FormData ajax 上传 IE8 -> 替代品及其工作原理
- jquery设置隐藏的输入值在IE7和IE8中未按预期工作
- 在 IE8 中单选按钮上更改无法正常工作
- 如何让 jQuery methos text() 函数在 IE8 中工作
- 重写一个Javascript函数,该函数可以选择在IE8中工作的活动导航选项卡
- 修复了在页面底部加载时html5标签IE8不工作的问题
- js库无法在IE8中工作
- 输入类型=“file".submit()不工作IE8
- 让cufon在IE7中工作IE8 -我已经按照文档做了所有的事情