Javascript 当我们打开对话框时,如何为jquery ui对话框属性赋值?
我有一个javascript函数,它打开一个jquery对话框: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
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"/>