Issue: Trouble with calling jQuery UI method despite successful load.
Scenario: Working on a web application using Backbone framework, I have loaded jQuery and jQuery UI in the following manner:
require (['jquery', 'app', 'biginteger', 'jqueryui'], function ($, App) {
App.initialize();
});
Within my view, the code checks for jQuery UI as shown below:
if (jQuery.ui) {
console.log('jQuery.ui is loaded');
$('#pg_calendar').dialog();
}
else {
console.log('jQuery.ui is not loaded');
}
While the console confirms that 'jQuery.ui is loaded', the subsequent call to the dialog() method fails with an error message:
Uncaught TypeError: $(...).dialog is not a function
at child.EventSelected (v_calendar.js:277)
at HTMLDivElement.dispatch (jquery-2.1.4.min.js:3)
at HTMLDivElement.r.handle (jquery-2.1.4.min.js:3)
I would greatly appreciate any suggestions or troubleshooting tips for this issue.