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
dijit is the package that contains the widget library for Dojo Toolkit. It requires the core of the Dojo Toolkit and provides a framework for building additional widgets as well as a full set of rich user interface widgets including form, layout and data-aware items.
Dijit is a widget system layered on top of Dojo. If you are new to the whole Dojo experience, Dijit is a good place to start. You can build amazing Web 2.0 GUI's using very little, or no, JavaScript (though having an understanding of JavaScript will take you a long way, as will a good understanding of HTML and CSS).
The Dojo Toolkit ships with the Dijit framework, which is a set of graphical controls called widgets. We can build graphical user interfaces with these widgets.
dijit.byId
returns a dijit object by some id.
dojo.byId
is the equivalent of $()
. To get/set it's HTML, use
dojo.byId("my_id").innerHTML
dojo.byId("my_id").innerHTML = some_text`
Note that dojo.byId
is just a wrapper around document.getElementById
, so you can use all the basic functions.
dijit.byId("my_id") ----> returns the widget associated with the domNode.
dojo.byId("my_id") -----> returns the domNode itself.
dijit.byId("my_id").domNode.innerHTML
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With