Our pure JavaScript Scheduler component


Post by PinHsuehLi »

I'm an absolute beginner, so the first step is to include the library.
But I got this message:
< Uncaught ReferenceError: bryntum is not defined >

This is my html:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"> 
    <script src="main.js"></script>
    <script type="text/javascript" src="scheduler-1.1.2-trial/build/scheduler.umd.js"></script>
    <link id="bryntum-theme" rel="stylesheet" type="text/css" href="scheduler-1.1.2-trial/build/scheduler.dark.css">
</head>
<body>

</body>
</html>
and JS code:
var scheduler = new bryntum.scheduler.Scheduler();
console.log("Work with Scheduler..");
Nothing has accomplished even the simple console.
Do I miss something important?
Thanks for the help.

Post by johan.isaksson »

Hi,

You are including your main.js before scheduler.umd.js is loaded, so bryntum.xx does not yet exist. Either move main.js below scheduler.umd.js and use a DOMContentLoaded listener to create the scheduler when DOM is ready (https://developer.mozilla.org/en-US/doc ... tentLoaded) or move it to the bottom of body to accomplish the same thing.
Best regards,
Johan Isaksson

Post by PinHsuehLi »

johan.isaksson wrote:Hi,

You are including your main.js before scheduler.umd.js is loaded, so bryntum.xx does not yet exist. Either move main.js below scheduler.umd.js and use a DOMContentLoaded listener to create the scheduler when DOM is ready (https://developer.mozilla.org/en-US/doc ... tentLoaded) or move it to the bottom of body to accomplish the same thing.
Thanks!
It's helpful.
Is it a better way that accomplishes by the DOMContentLoaded listener?

Post Reply