- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › [Solved] Javascript Error – undefined is not a function
I’m trying to use the jquery treeview plugin (located at https://github.com/jzaefferer/jquery-treeview). The code that I currently have is at http://codepen.io/anon/pen/bdpGWK
The line with “$(“#browser”).treeview();” fails with the javascript error “Uncaught TypeError: undefined is not a function” in Google Chrome’s debugger. I do have an element with the id of browser and if I do alert($(“#browser”)) it is defined. However, it seems to not have loaded the .treeview method/library. When I googled on the issue, most people have forgotten to load jquery or the treeview library, but I can see that both of them are loaded in the sources tab of the google chrome debugger. I also tried adding breakpoints in the treeview library code and it does seem to be loading/initializing.
Does anyone have any ideas about why it isn’t working?
Thanks!
Here is a link to the treeview js file:
https://github.com/jzaefferer/jquery-treeview/blob/master/jquery.treeview.js
I’m not really sure if there is a CDN hosting it anywhere or how to get it into codepen.
I finally figured out my problem. In my real/complicated page, I was importing two different versions of jquery (1.4 and 1.7). The two versions were conflicting with each other, when I just imported one version of jquery, the problem went away.