TypeError: $.widget is not a function

2,454 views
Skip to first unread message

josephinsa...@yahoo.com

unread,
Oct 18, 2012, 5:54:29 PM10/18/12
to Discuss jquery.dynatree.js
Does anyone have any idea how I can get rid of this problem below?

<link media="screen" href="jquery-ui-1.8.17.custom/css/ui-lightness/
jquery-ui-1.8.17.custom.css" type="text/css" rel="stylesheet">
<link href="layout-default-latest.css" type="text/css"
rel="stylesheet">
<link type="text/css" rel="stylesheet" href="/bk/dynatree/
dynatree-1.2.2/src/skin/ui.dynatree.css">
<script src="jquery-1.6.1.min.js" type="text/javascript">
<script src="dynatree/dynatree-1.2.2/src/jquery.dynatree.js"
type="text/javascript">
<script src="theme2/jquery-ui-1.8.17.custom/js/jquery-
ui-1.8.17.custom.min.js" type="text/javascript">
<script src="jquery.layout-latest.js" type="text/javascript">
<script type="text/javascript">

code

$("#treeFile").dynatree({
onActivate: function(node) {
alert("You activated " + node.data.title);
},
children: [
{title: "Item 1"},
{title: "Folder 2", isFolder: true, key: "folder2",
children: [
{title: "Sub-item 2.1"},
{title: "Sub-item 2.2"}
]
},
{title: "Item 3"}
]
});
});

TypeError: $.widget is not a function
(?)()jquery...tree.js (line 2997)
$ = function()
jquery.dynatree.js()jquery...tree.js (line 3351)
[Break On This Error]

lastentry: undefined

hzhu

unread,
Oct 18, 2012, 7:04:36 PM10/18/12
to dyna...@googlegroups.com, josephinsa...@yahoo.com
you imported dynatree library before the jquery UI library. dynatree depends on jquery UI. Moving jquery UI above dynatree import should solve your problem.

josephinsa...@yahoo.com

unread,
Oct 18, 2012, 9:31:20 PM10/18/12
to hzhu, dyna...@googlegroups.com
thanks hzhu for your needed suggestion and I hopes it works.



From: hzhu <howi...@gmail.com>
To: dyna...@googlegroups.com
Cc: josephinsa...@yahoo.com
Sent: Thursday, October 18, 2012 4:04 PM
Subject: Re: TypeError: $.widget is not a function

you imported dynatree library before the jquery UI library. dynatree depends on jquery UI. Moving jquery UI above dynatree import should solve your problem.
 

On Thursday, October 18, 2012 5:54:29 PM UTC-4, josephinsa...@yahoo.com wrote:
Does anyone have any idea how I can get rid of this problem below?

<link media="screen" href="jquery-ui-1.8.17.custom/ css/ui-lightness/
jquery-ui-1.8.17.custom.css" type="text/css" rel="stylesheet">
<link href="layout-default-latest. css" type="text/css"
jquery.dynatree.js()jquery... tree.js (line 3351)

josephinsa...@yahoo.com

unread,
Oct 18, 2012, 9:43:55 PM10/18/12
to hzhu, dyna...@googlegroups.com
Your suggestion worked. Thanks hzhu....



From: hzhu <howi...@gmail.com>
To: dyna...@googlegroups.com
Cc: josephinsa...@yahoo.com
Sent: Thursday, October 18, 2012 4:04 PM
Subject: Re: TypeError: $.widget is not a function

you imported dynatree library before the jquery UI library. dynatree depends on jquery UI. Moving jquery UI above dynatree import should solve your problem.
 

On Thursday, October 18, 2012 5:54:29 PM UTC-4, josephinsa...@yahoo.com wrote:
Does anyone have any idea how I can get rid of this problem below?

<link media="screen" href="jquery-ui-1.8.17.custom/ css/ui-lightness/
jquery-ui-1.8.17.custom.css" type="text/css" rel="stylesheet">
<link href="layout-default-latest. css" type="text/css"
rel="stylesheet">
<link type="text/css" rel="stylesheet" href="/bk/dynatree/
dynatree-1.2.2/src/skin/ui. dynatree.css">
<script src="jquery-1.6.1.min.js" type="text/javascript">
<script src="dynatree/dynatree-1.2.2/ src/jquery.dynatree.js"
type="text/javascript">
<script src="theme2/jquery-ui-1.8.17. custom/js/jquery-
ui-1.8.17.custom.min.js" type="text/javascript">
<script src="jquery.layout-latest.js" type="text/javascript">
<script type="text/javascript">

code

        $("#treeFile"). dynatree({
onActivate: function(node) {
alert("You activated " + node.data.title);
},
children: [
{title: "Item 1"},
{title: "Folder 2", isFolder: true, key: "folder2",
children: [
{title: "Sub-item 2.1"},
{title: "Sub-item 2.2"}
]
},
{title: "Item 3"}
]
});
});

TypeError: $.widget is not a function
(?)()jquery...tree.js (line 2997)
$ = function()
jquery.dynatree.js()jquery... tree.js (line 3351)
Reply all
Reply to author
Forward
0 new messages