I would like to define a few variables that I use to span jQuery selectors later after the application layout has been displayed.
I tried to define them with:
Meteor.startup(function () { })
But it didn’t work, the objects were empty
Here's how I declare my application layout:
Router.configure({
layoutTemplate: 'layout'
});
Here is the layout itself:
<template name="layout">
<div id="page_container">
<header id="page_header">
</header>
<div id="page_content">
{{> yield}}
</div>
</div>
</template>
Here are the variables that I want to declare:
L.BODY = $("body");
L.PC = $("#page_content", L.BODY);
The declaration itself works great, but L.BODYshows that the body of my application is still empty by the time I try to declare these variables.
How can I define jQuery objects after displaying the layout of my application?
source
share