I am looking to test Widgets -> Dialog -> Modal Confirmation.
jquery-ui.js is heavy to load just for a specific use. From JQ UI site I downloaded a folder containing lots of small .js files
I guess they are part of the main js. I've tested to only load jquery.ui.widget.js and jquery.ui.dialog.js but I get this console error:
Uncaught TypeError: Object function ( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); } has no method 'widget'
Next codes are copy of the jQ UI sample from http://jqueryui.com/dialog/#modal-confirmation
Sample displays and works as expected loading the heavy query-ui.js file only
src="/js/jquery.ui.dialog.js"
src="/js/jquery.ui.widget.js"
$(function() {
$( "#dialog-confirm" ).dialog({
resizable: false,
height:140,
width:350,
modal: true,
buttons: {
"Accept": function() {
$( this ).dialog( "close" );
},
"Refuse": function() {
$( this ).dialog( "close" );
}
}
});
});
HTML
<div id="dialog-confirm" title="Confirmation">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>Select your option</p>
</div>