Meteor.startup(func) - when is the DOM "ready" in Meteor? -
http://docs.meteor.com/#meteor_startup
concerning meteor.startup(func)
on client, function run dom ready.
at point "dom ready"?
the reason why ask because can have meteor template uses many other templates (ie. other dom elements) inside of , have many other things loading @ different times depending on how long things take load (ie. more dom elements).
in past i've loaded javascript files on meteor.startup still loaded because entire dom had not been loaded yet.
meteor.startup( function() { //load js files });
so mean "dom ready?" not mean "when dom loaded in entirety."
meteor.startup runs when files have downloaded server (javascript files). if place code run @ startup without putting in meteor.startup may not run because run js/html has not been downloaded yet
this when 'dom ready', not when html rendered, because (the html) renders when dom ready too.
if you're looking runs after both dom ready , after page's html ready template's .rendered
callback - http://docs.meteor.com/#template_rendered
the confusion may come concept of $(document).ready
in jquery, applies because page rendered on server side can assume rendered on client (since downloaded way). in meteor pages rendered on client there slight difference.
Comments
Post a Comment