简体   繁体   English

JsTree没有拾取JavaScript文件

[英]JsTree not picking up javascript file

在此处输入图片说明

Hi I am not yet fluent with javascript coming from a C# background. 嗨,我还不太熟练使用来自C#背景的javascript。 I am using Jstree im my MVC project and I can display the tree populated with Json data. 我在我的MVC项目中使用Jstree,可以显示由Json数据填充的树。

However I cannot add any plugins etc, Jstree doesn't seem to be picking up my Javascript file. 但是我无法添加任何插件等,Jstree似乎没有获取我的Javascript文件。

In my Index.cshtml I have. 在我的Index.cshtml中。

<link href="@Url.Content("~/Content/jsTree/themes/default/style.css")" rel="stylesheet" type="text/css"/>

<script src="@Url.Content("~/Scripts/jsTree3/jstree.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/index.js")" type="text/javascript"></script>

In my index.js I have 在我的index.js中,

$(function () {
    $("#jstree").jstree({
        'core' : {
            'data' : { 
                'url ': "/SinqLaison/GetJsTree3Data",
                'dataType' : "json" 
            }
        }
    });
});

Any changes I make in the index.js file have no effect on the tree. 我对index.js文件所做的任何更改都不会对树产生影响。 Even if I remove the index.js file completely the tree displays the data like I'ts not picking up the index.js file at all. 即使我完全删除了index.js文件,树也显示了数据,就像我根本没有拿起index.js文件一样。

Am I using jstree correclty? 我在使用jstree correclty吗? Should all the javascript I write be written in the jstree.js file the comes in when importing Jstree? 导入Jstree时,是否应该将我编写的所有JavaScript都写在jstree.js文件中? and not in a custom index.js 而不是在自定义index.js中

many thanks. 非常感谢。

导入Nuget软件包时一定有一个小故障,我卸载了JsTree,然后重新安装了它,现在工作得很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM