Login Register

dijit.byId vs jsId

Does the jsId attribute work in all dijit declarations?

For example, if I have

<div id="foobar" jsId="jsFoobar" dojoType="dijit.Dialog">...</div>

Can I access the dijit object by either jsFoobar or dijit.byId('foobar')? I've been using the jsId way and it seems to work fine. Any downsides to it (besides it being a global variable)?

Thanks in advance.

jsFoobar does not have to be global

Here jsFoobar is namespaced.

...jsId="my.jsFoobar" dojoType="dijit.Dialog"...