【发布时间】:2016-03-17 15:28:20
【问题描述】:
我在bower_components 中安装了jsTree(使用this post 中的指导线),我的玉模板看起来像这样-
doctype html
html
head
title= title
script(src='/bower_components/jstree/dist/jstree.min.js')
script(src='/bower_components/jquery/dist/jquery.min.js')
link(rel='stylesheet', href='/stylesheets/style.css')
link(rel='stylesheet', href='/bower_components/jstree/dist/themes/default/style.css')
script(src='/javascripts/custom/mytree.js')
body
#mytreediv
ul
li First item
li Second item
脚本mytree.js 是我编写的脚本,我用jsTree 初始化mytreediv div 元素。脚本是这样的 -
alert('Test1');
var myfunc = function () {
alert('Test2');
$('#mytreediv').jstree();
};
myfunc();
两个alert 框都出现了,所以我很确定脚本已正确链接到 HTML。但是,div 元素看起来并没有转换为 jsTree。
我在这里错过了什么?
【问题讨论】:
标签: javascript node.js express jstree