Dojo toolkit: How to invoke $(document).someFunction() equivalent

I can't seem to figure out how to call a function from a .js file in my html page. The jquery equivalent is in the title:

$(document).someFunction();

But how do I do this in dojo? I seems like its really simple, but I can't figure it out :/

Thanks!

Answers


Dojo takes the approach of giving you functions you pass elements into, rather than giving you a wrapper object you call functions on the way jQuery does.

So for instance:

require(['dojo/dom', 'dojo/domClass'], function(dom, domClass) {
    var elm = dom.byId("someElement");
    domClass.add(elm, "class-to-add");
});

More in the 'Hello Dojo!' tutorial on the Dojo site.


Need Your Help

Automatic way for compersing value and hermeticity of tow DB tabels

sql oracle frameworks database-replication qa

As part of my workflow were I work we performs a lot of compressing

Column of same height with responsive image inside

css image responsive-design height multiple-columns

I'm working on a website and most of my page have this structure :