大佬教程收集整理的这篇文章主要介绍了dojo.byId and dijit.byId,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
This function is a synonym for document.all.id in IE or document.getElementById(id) in standard DOm. So you can say:
if Document.getElementById() works in all modern browsers,why use this? Sadly,bugs persist in Internet Explorer which make getElementById() unstable in some common scenarios. Also,dojo.byId() is easier to type.
Because of the almost-identical spelling,this method is commonly mixed up with dojo.byId(String id). Here's the difference: dijit.byId() returns a Dijit widget instance - technically,an instance of dijit._Widget or one of its subclasses like dijit.Toolbar or dijit.TreeNode.
So here's the way to remember it:
Or for you who think in terms of functions (e.g. LISP progrAMMers?):
var myDomNode = dojo.byId("foo"); var myWidget = dijit.byId("foo"); console.debug(myDomNode == myWidget.domNodE); // true console.debug(dijit.byNode(myDomNodE) == myWidget); // true
以上是大佬教程为你收集整理的dojo.byId and dijit.byId全部内容,希望文章能够帮你解决dojo.byId and dijit.byId所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。