您好,我有以下问题。在我的 asp.net mvc 页面(这是部分视图)中,我创建了一个 jsTree 实例,如下所示:
<script type="text/javascript">
$(function() {
$("#industries").tree({
callback: {
onselect: function(NODE, TREE_OBJ) {
$("#SelectedIndustryROWGUID").val($(NODE).attr("id"));
$("#resultMessage").append($(NODE).attr("rel"));
}
},
data: {
type: "json",
async: true,
opts: {
method: "GET",
url: "/CreateMessage/GetIndustries/"
}
}
});
});
这工作正常,但是当我点击页面上的任何链接时,它不起作用。当我从上下文菜单中选择“在新选项卡中打开”选项时,将执行链接。当我删除上述部分时,一切正常 有人可以帮我吗?
编辑 我已将上面的代码更改为如下:
<script type="text/javascript">
$(document).ready(function() {
$("#industries").tree({
callback: {
onselect: function(NODE, TREE_OBJ) {
$("#SelectedIndustryROWGUID").val($(NODE).attr("id"));
$("#resultMessage").append($(NODE).attr("rel"));
}
},
data: {
type: "json",
async: true,
opts: {
method: "POST",
url: "/CreateMessage/GetIndustries/"
}
}
});
});
(我添加了 $(document).ready(function() { ...但它也没有帮助
EDIT2 我也在 jsTree 讨论组上问过这个问题,我得到了答案。将 jquery 升级到 1.4.2 版本解决了这个问题!