3
我有我的网页上dijit.editor,当我点击一个按钮,我想我的编辑里面的内容。这应该相当简单,但我现在已经偶然发现了它。如何从Dijit.Editor获取价值?
没关系,我解决了这个问题。
dojo.require("dijit.Editor");
dojo.addOnLoad(function() {
var editor = dijit.byId("myEditor");
var btn1 = dojo.byId("Button1");
editor.attr("value", "Hej igen");
editor.onLoadDeferred.addCallback(function() {
editor.atte("value", "<b>This is new content.</b>");
});
btn1.onclick = function() {
// alert(editor.domNode.innerHTML);
alert(editor.attr("value"));
}
});
你也许可以回答你自己的问题,并把它设置为接受的答案,以防万一有人(像我)有同样的问题,并不能立即看到答案是什么。 – peirix 2010-04-23 12:02:46
我同意 - “没关系,我解决了”阅读非常令人沮丧 - 如果你想参与社区网站,请给予以及接受。你是如何解决它的? – Grouchal 2010-07-29 08:27:02
Grouchal,他列出了答案:editor.attr(“value”) – 2011-02-16 01:58:51