question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Which event should be used to start the code?

See original GitHub issue

When I used window.addEventListener('load', () => app(...)) the subs didn’t work correctly, as they never seemed to receive the event. How should we handle this without adding the <script> to the last line of the HTML?


Note: It should work with both <script async ...> and <script> if possible.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:32 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
jorgebucarancommented, Feb 8, 2017

@dodekeract Ah, what @tunnckoCore said. Good job on catching that!

1reaction
FlorianWendelborncommented, Feb 8, 2017

@jbucaran That’s one way to put it, yes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to events - Learn web development | MDN
Events are actions or occurrences that happen in the system you are programming, which the system tells you about so your code can...
Read more >
Introduction to browser events - The Modern JavaScript Tutorial
An event is a signal that something has happened. All DOM nodes generate such signals (but events are not limited to DOM).
Read more >
Handling Events :: Eloquent JavaScript
Though we have ignored it so far, event handler functions are passed an argument: the event object. This object holds additional information about...
Read more >
What is an event handler and how does it work? - TechTarget
An event handler dictates the action that takes place in a software program after an event. In this article, we explain how event...
Read more >
JavaScript Events - W3Schools
HTML events are "things" that happen to HTML elements. When JavaScript is used in HTML pages, JavaScript can "react" on these events.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found