Wednesday, 31 October 2018

Electron TypeError: $(...).jstree is not a function when i try to use it

i'm using jstree i have downloaded code from here https://www.jstree.com/

found jstree.js from dist folder and put into my /js/jstree.js

imported jstree like this:

if(inElectron()){
    window.jQuery = require('./js/jquery.min.js');
    window.$ = window.jQuery;
    window.jstree = require('./js/jstree.js');
}

when i try to use it:

$('#jstree').jstree();// for just demo with minimal code (Actually i'm using full code from here http://jsfiddle.net/t4s7dz52/)

i'm getting below error:

"TypeError: $(...).jstree is not a function

Note: i'm able to use jQuery throughout project ,so no import error as both js are in same folder

Please help me thanks in advance!!!!



from Electron TypeError: $(...).jstree is not a function when i try to use it

2 comments:

  1. Please help, i have same problem with nw.js , this code not work.

    ReplyDelete