Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing jQuery UI Dialog, how can I load content from another webpage?
    primarykey
    data
    text
    <p>The title says everything exept one thing: I dont want to add a <code>&lt;div id="something"&gt;&lt;/div&gt;</code> in the body of my webpage.</p> <p>I found this on the internet:</p> <pre><code>var $mklib = $('&lt;div&gt;&lt;/div&gt;') .html('test') .dialog({ title: "Create a library", autoOpen: false, show: "fade", hide: "fade", draggable: false, resizable: false, height: 150, width: 300, buttons: { "Create": function() { $(this).dialog("close"); } }, }); $( ".open_mklib" ).click(function() { $mklib.dialog( "open" ); return false; }); </code></pre> <p>But I need the <code>.html('test')</code> to be <code>'load_that_*****_page.php'</code></p> <p>And off topic, I need the create button to send the form that will be inside the <code>load_that_*****_page.php</code>...</p> <p>Any superhuman to the rescue?</p> <p>Thanks a lot!</p> <hr> <p>Okay guys I got it on the internet, here is the code, but when I click Submit, it doesnt work! :P (URL: <a href="http://magix-cjquery.com/post/2010/08/01/jquery-ui-dialog-avec-soumission-de-formulaire-ajax" rel="nofollow">http://magix-cjquery.com/post/2010/08/01/jquery-ui-dialog-avec-soumission-de-formulaire-ajax</a>)</p> <pre><code>$('.open_mklib').live("click",function(){ var box_url = "./functions/modal.php"; var form_url = "./"; $("#mklib").load(box_url, function() { $(this).dialog({ title: 'New Library', height: 'auto', width:'auto', resizable: false, modal: true, position: 'center', overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Submit': function() { $("#mklib form").ajaxSubmit({ url: box_url, type: "post", error: function(){ alert("theres an error with AJAX"); }, beforeSubmit:function(){}, success: function(e){} }); $(this).dialog('close'); }, 'Cancel': function() { $(this).dialog('close'); } } }); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload