About 12,800,000 results
Open links in new tab
  1. Detecting the onload event of a window opened with window.open

    Jun 13, 2010 · var popup = window.open(location.href, "snapDown"); popup.onload = function() { alert("message one"); }; alert("message 1 maybe too soon\n" + popup.onload); popup.onload …

  2. javascript - HTML - Alert Box when loading page - Stack Overflow

    You can use a variety of methods, one uses Javascript window.onload function in a simple function call from a script or from the body as in the solutions above, you can also use jQuery …

  3. onload Event - W3Schools

    The onload event can be used to check the visitor's browser type and browser version, and load the proper version of the web page based on the information. The onload event can also be …

  4. Why doesn't onload event work on a tab opened with window.open?

    Now I wish to execute some code on that page after its dom will have been loaded. I use the onload event as: function foo(){ var mytext = wild.document.body.textContent; alert( mytext ); } …

  5. Window: load event - Web APIs | MDN - MDN Web Docs

    May 2, 2025 · Learn about the load event, including its type and syntax, code examples, specifications, and browser compatibility.

  6. Window alert() Method - W3Schools

    The alert() method displays an alert box with a message and an OK button. The alert() method is used when you want information to come through to the user. The alert box takes the focus …

  7. HTML onload Event Attribute - W3Schools

    Execute a JavaScript immediately after a page has been loaded: More "Try it Yourself" examples below. The onload attribute fires when an object has been loaded. onload is most often used …

  8. How to show alert message on page load in JavaScript

    May 7, 2023 · Fortunately, it's easy to show an alert message using JavaScript when someone visits your website. In this article, I will discuss how you can use JavaScript code snippets to …

  9. How to Handle the JavaScript onload Event - JavaScript Tutorial

    To handle the load event, you register an event listener using the addEventListener() method: console.log('The page has fully loaded'); Alternatively, you can use the onload property of the …

  10. javascript - When to use "window.onload"? - Stack Overflow

    In JavaScript, when I want to run a script once when the page has loaded, should I use window.onload or just write the script? For example, if I want to have a pop-up, should I write …

Refresh