How to display an IFRAME inside a jQuery UI dialog

The problems were: iframe content comes from another domain iframe dimensions need to be adjusted for each video The solution based on omerkirk’s answer involves: Creating an iframe element Creating a dialog with autoOpen: false, width: “auto”, height: “auto” Specifying iframe source, width and height before opening the dialog Here is a rough outline of … Read more

Error: TypeError: $(…).dialog is not a function

Be sure to insert full version of jQuery UI. Also you should init the dialog first: $(function () { $( “#dialog1” ).dialog({ autoOpen: false }); $(“#opener”).click(function() { $(“#dialog1″).dialog(‘open’); }); }); <script src=”https://code.jquery.com/jquery-1.11.1.min.js”></script> <script src=”https://code.jquery.com/ui/1.11.1/jquery-ui.min.js”></script> <link rel=”stylesheet” href=”https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css” /> <button id=”opener”>open the dialog</button> <div id=”dialog1″ title=”Dialog Title” hidden=”hidden”>I’m a dialog</div>

jQuery UI Dialog OnBeforeUnload

The correct way to display the alert is to simply return a string. Don’t call the alert() method yourself. <script type=”text/javascript”> $(window).on(‘beforeunload’, function() { if (iWantTo) { return ‘you are an idiot!’; } }); </script> See also: https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload

Passing data to a jQuery UI Dialog

jQuery provides a method which store data for you, no need to use a dummy attribute or to find workaround to your problem. Bind the click event: $(‘a[href*=/Booking.aspx/Change]’).bind(‘click’, function(e) { e.preventDefault(); $(“#dialog-confirm”) .data(‘link’, this) // The important part .data() method .dialog(‘open’); }); And your dialog: $(“#dialog-confirm”).dialog({ autoOpen: false, resizable: false, height:200, modal: true, buttons: { … Read more

jQuery UI – Close Dialog When Clicked Outside

Sorry to drag this up after so long but I used the below. Any disadvantages? See the open function… $(“#popup”).dialog( { height: 670, width: 680, modal: true, autoOpen: false, close: function(event, ui) { $(‘#wrap’).show(); }, open: function(event, ui) { $(‘.ui-widget-overlay’).bind(‘click’, function() { $(“#popup”).dialog(‘close’); }); } });

How to remove close button on the jQuery UI dialog?

I have found this worked in the end (note the third line overriding the open function which find the button and hides it): $(“#div2”).dialog({ closeOnEscape: false, open: function(event, ui) { $(“.ui-dialog-titlebar-close”, ui.dialog || ui).hide(); } }); To hide the close button on all dialogs you can use the following CSS too: .ui-dialog-titlebar-close { visibility: hidden; … Read more