javascript - dojo dom manipulation after page load -
i think question asked, surprised see dojo not behaving per docs. want div changed particular class. decided use
dojo.ready(function(){ });
but running before page loaded. used addonload() function. gave same result. ended doing this
require(["dojo/domready"], function(domready) { domready(function () { settimeout(function(){ setafrobeat(); },500); }); });
that working fine, times see blink there delay, , few times doesn't work. if increase timeout 1000 works always, user can see content modification. perfect way used in jquery's document.ready
regards
aadam
the way loading domready typical module instead of dojo plugin "!" convention per dojo documentation http://dojotoolkit.org/documentation/tutorials/1.8/modules/ see using plugins.
to use domready correctly should this..
require(["dojo/domready!"], function(){ // not run until dom finished loading });
http://dojotoolkit.org/reference-guide/1.10/dojo/domready.html outlines when , how use dojo/domready! vs dojo/ready
Comments
Post a Comment