0
。在我的asp.net应用程序中使用<code>HTML Editor</code>(ajax工具包)在页面加载时设置的Ajax工具箱HTML编辑器的值
问题:我的问题是,当我想分配或设置在页面加载价值HTMLEditor
,但它不工作(下面的代码)。
但使用相同的代码,我可以检索或成功获取值。
的JavaScript:
<script type="text/javascript">
$(document).ready(function()
{
document.getElementById("ContentPlaceHolder1_Editor1_ctl02").contentWindow.innerHTML = "Some value from db";
// not working :(
});
function getValue()
{
var content = document.getElementById("ContentPlaceHolder1_Editor1_ctl02_ctl00").contentWindow.document.body.innerHTML
// this working perfect.
}
function copyText()
{
document.getElementById("ContentPlaceHolder1_Editor1_ctl02").contentWindow.innerHTML = "Some Value from another div";
// working perfect.
}
</script>
我的问题是我不能够在文件准备功能,以设置HTML Editor
值。但同样我可以复制另一个div的内容,我可以在HTML Editor
中设置该文本。
请给我建议,我怎么能在HTML Editor
设定的值document.ready
事件中
感谢,