/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type="text/javascript"> $(function() { // dialog prepare function $.prepare_dialog = function() { $(document).find('body').append('<div id="generic_dialog"></div>'); $('#generic_dialog').dialog({ autoOpen: false, bgiframe: true, resizable: true, height:400, width: 800, modal: true, buttons: { 'Close': function(){ $(this).dialog('close'); } } }); } // dialog content polling $.fetch_dialog_content = function() { $.ajax({ type: 'POST', url: '{{$base_url_lang}}' + 'system/test/acl_editor_test/get_dialog_content', success: function(html_input){ $('#generic_dialog').html(html_input); $('#generic_dialog').dialog('open'); } }); } // "click" event registration $('#open_first_editor').click(function(){ $.fetch_dialog_content(); }); // dialog preparation $.prepare_dialog(); }); </script> <div id="main_content"> <a id="open_first_editor">Open First Dialog</a> </div>