Javascript 初始化后如何更改jQuery对话框html内容?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3780695/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change jQuery dialog html content after init?
提问by Erez
I have a working dialog, and i want to change the content during the flow of the app, I mean to change the .html() property of the dialog...
我有一个工作对话框,我想在应用程序的流程中更改内容,我的意思是更改对话框的 .html() 属性...
I thought it was easy to do but i can't seem to do:
我认为这很容易做到,但我似乎做不到:
$dialog.dialog().html(SOME CONTENT);
$dialog.dialog().html(一些内容);
How do I do that after I already have the dialog running?
在我已经运行了对话框之后,我该怎么做?
My init code is:
我的初始化代码是:
var $dialog = $('<div></div>')
.html(SplitTable)
.dialog({
autoOpen: false,
height: 500,
width: 600,
title: '????? ?????'});
$dialog.dialog('open');
where is the ID in that? this is the what i understood i should do from the examples, didn't see any Id property...
那个ID在哪里?这是我从示例中理解的我应该做的事情,没有看到任何 Id 属性...
p.s. splitTableis the content that i need to change during to program to updatTable...
ps splitTable是我在编程到updatTable期间需要更改的内容...
10x
10倍
回答by Nick Craver
回答by trrrrrrm
$('#dialog ID').html('SOME CONTENT');