因此,我有一个html页面,其中包含如下代码片段
<span dojoType='dijit.InlineEditBox' editor='dijit.form.Textarea' id='actionDetails13' value='Leave admit source entered during Express Registration' autoSave='false' noValueIndicator='[Details]'>
<script type='dojo/connect' event='onChange' args='value'>
</script>
</span> 这在chrome和IE中工作得很好,但是当页面非常大时,只有internet explorer会抛出错误
DOM Exception: NOT_FOUND_ERR (8)而那些特定的inlineeditbox将不再出现。因此,在1000个inlineedit框中,可能有70%会被渲染。
如果我注释掉脚本type='dojo/connect‘,则不会抛出任何错误。
我认为这可能是IE的一些限制,但您知道是什么原因造成的吗?
发布于 2013-08-19 18:15:13
也许这是你连接onClick-event的方式。
像这样试一下:
<script type="dojo/on" data-dojo-event="click">
on(registry.byId("button1"), "click", function(){
console.log("I was clicked!");
});
</script>问候你,米里亚姆
发布于 2013-08-20 01:29:37
我建议使用下面的代码。这对我很管用。
require([
"dojo/dom-attr",
"dojo/on",
"dojo/domReady!"
], function ( domAttr,on) {
var actionDetails13 = dojo.byId("actionDetails13");
var handle = on(actionDetails13 , "change", customFunction);
function customFunction() {
var actionDetails13Value= domAttr.get("actionDetails13", "value");
//your code
};
});参考:
https://dojotoolkit.org/reference-guide/1.9/dojo/connect.html
https://dojotoolkit.org/reference-guide/1.9/dojo/dom-attr.html
https://stackoverflow.com/questions/18303447
复制相似问题