Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript execute code on page load

<html>
 
  <body onload="loaded();"></body>
  <script>
    function loaded() {
      alert('Page is loaded');
    }
 
  </script>
 
</html>
Comment

run on load js

function codeAddress() {
            alert('ok');
        }
window.onload = codeAddress;
Comment

PREVIOUS NEXT
Code Example
Javascript :: react app.js 
Javascript :: An accessor cannot be declared in an ambient context. 
Javascript :: js exec vs match 
Javascript :: javascript get uploaded file name 
Javascript :: gatsby-plugin-create-client-paths 
Javascript :: this.$router.push nuxt 
Javascript :: prettier semicolon false in javascript 
Javascript :: how to get day from javascript date 
Javascript :: js remove from array by value 
Javascript :: js go back 
Javascript :: hashtag strategy angular 
Javascript :: random hexadecimal character js 
Javascript :: jquery Audio Play on button click 
Javascript :: check either define or undefined in javascript 
Javascript :: javascript give class to element 
Javascript :: js string slice last n elements 
Javascript :: refresh page after delete angular 
Javascript :: nestjs cors origin 
Javascript :: odd even condition with ternary operator in javaScript 
Javascript :: jquery validation plugin 
Javascript :: react redux actions must be plain objects 
Javascript :: javascript escape quote method 
Javascript :: A form label must be associated with a control react 
Javascript :: vscode prettier use tabs 
Javascript :: redirect link javascript 
Javascript :: color p5js 
Javascript :: qrcode.js 
Javascript :: component unmount useeffect 
Javascript :: react native heroicons 
Javascript :: jquery page finished loading 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =