I have this jquery code embedded in an app…I am just not sure why I am encountering the error
$().toggleField() is not a function
in the browser. I checked that jQuery and jQueryUI is loaded but I am not sure why I am encountering such errors.
(function ($) {
$.widget("ui.toggleField", {/*more code*/});
})(jQuery);
$(document).ready(function() {
$(".data").toggleField();
});
Update
Code is almost like this. As it has more info so I edited it for clarity
(function ($) {
$.widget("ui.toggleField", {
options: {
/*More Options*/
},
_create: function () {
/* More Code */
},
expand: function(animate) {
/* More Code */
},
collapse: function(animate) {
/* More Code */
}
});
})(jQuery);
$(document).ready(function() {
$(".data").toggleField();
});
.. it’s a custom plugin created by somebody. I am just trying to integrate it to my html file.
The code you have shown is working perfectly fine.
See this: http://jsfiddle.net/qqqJJ/
The issue seems to be in your
_createmethod.