Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript - How to execute a function when page has fully loaded?

That's called load. It came waaaaay before DOM ready was around, and DOM ready was actually created for the exact reason that load waited on images.

window.addEventListener('load', function () {   alert("It's loaded!") }) 
Comment

call a function when page is loaded

<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script type="text/javascript">

    $(document).ready(function () {
        yourFunction();
    });
    function yourFunction(){
      //some code
    }
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript clone array of object 
Javascript :: JS get min date 
Javascript :: javascript array of zeros of n length 
Javascript :: get all div elements javascript 
Javascript :: bootstrap carousel click event next previous 
Javascript :: reactjs firebase nested arrays are not supported 
Javascript :: ffmpeg convert mp4 to avi 
Javascript :: elasticsearch field not exists 
Javascript :: angular maxlength directive input type number 
Javascript :: localstorage javascript 
Javascript :: javascript replace last character 
Javascript :: jquery validation form submit 
Javascript :: today in moment 
Javascript :: back button next js 
Javascript :: angular minutes to hour and minutes 
Javascript :: link regex 
Javascript :: jest array contain object with prop 
Javascript :: generate random color javascript 
Javascript :: transform javascript 
Javascript :: EVERY METHOD 
Javascript :: javascript string lentrh 
Javascript :: jQuery select elements by name 
Javascript :: javascript array random selector 
Javascript :: javascript change div order 
Javascript :: material ui textfield error 
Javascript :: material ui jss media query 
Javascript :: in puppeteer wait for page untile certain selector have certain value 
Javascript :: react hooks delete item from array 
Javascript :: mongoose update createdAt 
Javascript :: how to append rows in table using jquery each function 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =