dojo.byId 和 dijit.byId 有什么区别?
每次尝试获取页面中元素的值时,都会出现未定义的错误:我已尝试 dijit.byId('myid').innerHTML('loading...');
dijit.byId('myid').innerHTML('loading...');
我收到错误 但是当我使用 jquery 执行相同操作时,它可以工作 $('#myid').html('loading ...')
这相当于什么 $('#myid') ').html()
在道场? 感谢您的任何建议
Each time am trying the get the value of an element in my page, I have an error as is undefined: I have tried dijit.byId('myid').innerHTML('loading...');
I get an error
but when i do the same using jquery, it works $('#myid').html('loading ...')
And what is the equivalent of this $('#myid').html()
in dojo?
Thanks for any advise
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
dijit.byId
通过某个 id 返回一个 dijit 对象。dojo.byId
相当于$()
。要获取/设置它的 HTML,请使用请注意,
dojo.byId
只是document.getElementById
的包装器,因此您可以使用所有基本功能。dijit.byId
returns a dijit object by some id.dojo.byId
is the equivalent of$()
. To get/set it's HTML, useNote that
dojo.byId
is just a wrapper arounddocument.getElementById
, so you can use all the basic functions.使用 dijit 访问 domNode:
To access the domNode using dijit: