Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当我们打开对话框时,如何为jquery ui对话框属性赋值?_Javascript_Jquery_Jsp_Jquery Ui Dialog - Fatal编程技术网

Javascript 当我们打开对话框时,如何为jquery ui对话框属性赋值?

Javascript 当我们打开对话框时,如何为jquery ui对话框属性赋值?,javascript,jquery,jsp,jquery-ui-dialog,Javascript,Jquery,Jsp,Jquery Ui Dialog,我有一个javascript函数,它打开一个jquery对话框: function new_popup() { var editor = "victorio"; //want to give var sex = "male"; //want to give $("#new-dialog-form").dialog({ autoOpen: false, height: 700, width: 800, mod

我有一个javascript函数,它打开一个jquery对话框:

function new_popup() {
    var editor = "victorio"; //want to give
    var sex = "male";  //want to give
    $("#new-dialog-form").dialog({
        autoOpen: false,
        height: 700,
        width: 800,
        modal: true,
        title: "New Dialog",
        buttons: { //.....buttons whatever.....
        },
        close: function() {
        }
    });
    $("#new-dialog-form").load('<%=newPopupUrl%>').dialog('open');
}
因此,当我们打开“新建”对话框时,这两个标签将使用给定的值自动完成


如何为对话框提供值,以及如何在新jsp中获取和设置给定值?谢谢你的帮助

使用
open
回调设置值,就像在对话框定义中使用
close
回调一样。您可以给我一些示例,如何在该打开的回调中设置值吗?非常感谢。这是基本的jQuery。。。所以类似于
open:function(){$('#editor').html(editor);$('#sex').html(sex);}
<label class="form_label" id="editor"/>
<label class="form_label" id="sex"/>