Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. T

    JavaScript function run without being called

    No problem, buddy! Glad I could help :thumbsup:
  2. T

    JavaScript function run without being called

    What happens when you use the `once` option? document.addEventListener("DOMContentLoaded", (event) => //runs after page fully loaded getRandomNumber(); alert("DomContentLoaed"); }, {once: true});
  3. T

    JavaScript function run without being called

    Is the submit button in a form? If so, it could be that pressing the submit button causes a page reload, which calls the `DOMContentLoaded` event to fire a second time.
Back
Top Bottom