Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Dialog showing only once
    primarykey
    data
    text
    <p>I'm having a pickle with my jQuery. The situation is as follows: I'm having a page loaded (main page). When clicked on a certain element, a div is opened loaded with another page(page1). Within this loaded page, I have a button, which opens a dialog, containing another loaded page (page2). </p> <p>This all works fine, for one time. When I close the dialog, it doesn't appear again when clicked on the button on page1. </p> <p>I've searched the interwebs, but the solutions are not helping me. I can't figure out what I'm doing wrong here. It's a very common problem, but I seem to have the code right, right?</p> <p>This is my code (the usefull part, anyway):</p> <pre><code>&lt;script&gt; $(document).ready(function(e) { $("#editdialog").dialog({ autoOpen: false, width: 400, height: 600, }); $(".editfreight").one("click", function(){ $("#editdialog").load("inc/ajax/editfreight_ajax.php?id=" + $(this).data("freight")); $("#editdialog").dialog("open"); }); }); &lt;/script&gt; &lt;div id="editdialog" style="display: hidden"&gt;&lt;/div&gt; </code></pre> <p>Well, i'm hoping someone can help me out here! I've also tried this:</p> <pre><code>$(".editfreight").one("click", function(){ $("#editdialog").dialog({ autoOpen: false, width: 400, height: 600, close: function() { $("#editdialog").dialog("destroy") }); $("#editdialog").load("inc/ajax/editfreight_ajax.php?id=" + $(this).data("freight")); $("#editdialog").dialog("open"); )}; </code></pre> <p>This way, I figured I initiate the dialog when I click the button (and not on pageload), and destroy the instance when I close the dialog. Apparently this isn't working either. </p>
    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