Dojo.NodeList.append()
此函数给我运行类似于以下位置提供的示例的问题: http://dojotoolkit。 org/api/1.5/dojo/NodeList#append
我的尝试:
<div class = "foo"><p>Hello Mars</p></div>
<div class = "foo"><p>Hello World</p></div>
<script type="text/javascript">
dojo.addOnLoad(function(){
console.debug(dojo.query("div.foo"));
dojo.query("div.foo").append("<span>append</span>");
});
</script>
我从 Google Web Toolkit 调试器得到的错误:
Uncaught TypeError: Object [object HTMLDivElement],[object HTMLDivElement] has no method 'append'
(anonymous function) myHTML:333
dojo.loaded myHTML:333
dojo._callLoaded dojo.xd.js:14
dojo._xdNotifyLoaded dojo.xd.js:14
dojo._xdWatchInFlight dojo.xd.js:14
(anonymous function) dojo.xd.js:14
对于可能出现的问题有什么想法吗?
This function is giving me trouble running something similar to the example provided at: http://dojotoolkit.org/api/1.5/dojo/NodeList#append
My attempt:
<div class = "foo"><p>Hello Mars</p></div>
<div class = "foo"><p>Hello World</p></div>
<script type="text/javascript">
dojo.addOnLoad(function(){
console.debug(dojo.query("div.foo"));
dojo.query("div.foo").append("<span>append</span>");
});
</script>
Error I get from Google Web Toolkit Debugger:
Uncaught TypeError: Object [object HTMLDivElement],[object HTMLDivElement] has no method 'append'
(anonymous function) myHTML:333
dojo.loaded myHTML:333
dojo._callLoaded dojo.xd.js:14
dojo._xdNotifyLoaded dojo.xd.js:14
dojo._xdWatchInFlight dojo.xd.js:14
(anonymous function) dojo.xd.js:14
Any thoughts as to what might be the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在dojo论坛上得到了某人的答案:
Got the answer from someone on the dojo forums: