我想创建就地编辑的东西,我想从创建一个文本可以编辑的div开始......但我面临一个问题:就地编辑困难
Uncaught TypeError: Cannot call method 'setAttribute' of null
这里是我的代码:
var node = dojo.createElement("div");
node.setAttribute("id", "ieb");
var area = new Textarea();
var newContent = document.createTextNode("When you click on this div you'll be able to edit it (in plain text).The editor's size will initially match the size of the (original) text, but will expand/contract as you type.");
node.appendChild(newContent);
var eb = new InlineEditBox({
editor: area,
autoSave: false
}, "ieb");
我到底错在这里做什么?或者我错过了什么?
我试图遵循一个长着这个教程:提前 http://dojotoolkit.org/reference-guide/1.9/dijit/InlineEditBox.html
感谢...新道场..
编辑: 好像它进入inlineeditbox。 js和打破此行:this.displayNode.setAttribute("role", "button");
是新的Textarea();道场的事情或错误? – dandavis
你好..这是一个道场的事情 – BigBug
我的不好。我们在这里看到很多垃圾,上次我检查了它,dojo使用了命名空间。我想即时通讯不是最新的五年的javascript怪胎,永远不会去任何地方... – dandavis