when I use the dialog to show a new page, it can be used only once and always show the same thing in the page

后端 未结 2 1267
滥情空心
滥情空心 2021-01-25 18:48

Hello this is the first time I\'m using dialog. Here is my code:

       $(\"#dialog\").dialog({
        autoOpen: false,
        closeOnWscape: true,
        sho         


        
相关标签:
2条回答
  • 2021-01-25 19:25

    Place this script on your pages to prevent jQuery ajax calls from caching their responses.

    $(function() {
       $.ajaxSetup({ cache: false });
    });
    

    jquery.load() will cache responses without it.

    See this for more information.

    0 讨论(0)
  • 2021-01-25 19:42

    Not sure why but you are putting the close event in the buttons option list and you misspelled closeOnEscape. Try:

    $("#dialog").dialog({
        autoOpen: false,
        closeOnEscape: true,
        show: "blind",
        width: 800,
        buttons: {
            "Close": function () {
                alert("close");
                $(this).dialog("close");
    
            }
        }
    
    });
    
    0 讨论(0)
提交回复
热议问题