How to create jQuery Dialog in function

后端 未结 3 1360
抹茶落季
抹茶落季 2021-02-05 11:01

Does anyone know how to create a jQuery Dialog in a function? I can\'t find an attribute to set the message... In every example I found, the dialog has been statically written i

3条回答
  •  广开言路
    2021-02-05 12:06

    Here is a simple example:

    function openDialog(message) {
        if ($('#dialog').length == 0) {
            $(document.body).append('
    '+message+'
    '); } else { $('#dialog').html(message); } $( "#dialog" ).dialog({ autoOpen: false, show: "blind", hide: "explode" }); $( "#dialog" ).dialog("open"); }

提交回复
热议问题