Skip to content

Execution order of js notes #4222

Answered by sottey
sottey asked this question in Show and tell
Aug 31, 2023 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

So, for whatever reason, including the Calendar.js as a separate note (first in the sequence of JS notes) did not work as the scope was insufficient for the calendarJs function. (causing the error above)

Moving that from the independent note into a <script> block in the top HTML (html Trilium note), as well as having all my custom variables referenced with the prefix "window." solved it.

@zadam , is there a way to change the scoping on a function? Is this expected behavior?

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@sottey
Comment options

Answer selected by sottey
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants