双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

jQuery的simpleTree树的问题

forgetbefore forgetbefore 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我下了simpleTree树的源码下来,运行它的源码 在IE和Firefox下都正常。
为什么我自己模仿它的例子写的就只能在ie下运行,在firefox下就会出错?

testTree.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="simpleTree.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.simple.tree.js"></script>
<script type="text/javascript">
var simpleTreeCollection;
$(document).ready(function(){
simpleTreeCollection = $(".simpleTree").simpleTree({
animate:true,
autoclose: false,
drag:true
});
});
</script>
</head>

<body>

<ul class="simpleTree">
<li class="root" id='1'><span>标题</span></li>
<ul>
<li class="open" id='2'><span>根</span>
<ul class="ajax">
<li id='4'>{url:loadTree.html}</li>
</ul>
</li>
</ul>
</ul>
</body>
</html>


loadTree.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<li id="5"><span class="text">11</span></li>
<li id="6"><span class="text">12</span>
<ul>
<li id="7"><span class="text">121</span></li>
<li id="8"><span class="text">122</span></li>
<li id="9"><span class="text">123</span></li>
</ul>
</li>
<li id="10"><span class="text">13</span></li>
<li id="11"><span class="text">14</span></li>
</body>
</html>
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
forgetbefore
JavaScript 87,983 成员 224,680 内容