onlycode.org

javascript
jquery
html
css
angularjs
node.js
ajax
html5
php
json
arrays
google-chrome
dom
regex
reactjs
ecmascript-6
javascript-events

your's history:
that executes after page...

that executes after page load, just only code

pageload | javascript-events | html | javascript

edit
<body onload="script();">
document.onload = function ...
window.onload = function ...

48
marcgg, 30.04.2009 19:41




edit
if(window.attachEvent) {
    window.attachEvent('onload', yourFunctionName);
} else {
    if(window.onload) {
        var curronload = window.onload;
        var newonload = function(evt) {
            curronload(evt);
            yourFunctionName(evt);
        };
        window.onload = newonload;
    } else {
        window.onload = yourFunctionName;
    }
}

47
chaos, 30.04.2009 19:59




edit
...<body onload="myFunction()">...
$(document).ready(function(){ /*code here*/ }) 

or 

$(window).load(function(){ /*code here*/ })

46
Nordes, 30.04.2009 19:42




edit
document.addEventListener("DOMContentLoaded", function(){
    //....
});
window.addEventListener("load", function(){
    // ....
});

45
RageFoxx, 19.03.2016 02:50



edit
<script src="demo_defer.js" defer></script>

29
Daniel Price, 10.01.2014 10:52




edit
<script type="text/javascript">
  function downloadJSAtOnload() {
      var element = document.createElement("script");
      element.src = "deferredfunctions.js";
      document.body.appendChild(element);
  }

  if (window.addEventListener)
      window.addEventListener("load", downloadJSAtOnload, false);
  else if (window.attachEvent)
      window.attachEvent("onload", downloadJSAtOnload);
  else window.onload = downloadJSAtOnload;
</script>

28
Lucky, 05.02.2013 14:40




edit
<script type="text/javascript">
  function downloadJSAtOnload() {
   var element = document.createElement("script");
   element.src = "defer.js";
   document.body.appendChild(element);
  }
  if (window.addEventListener)
   window.addEventListener("load", downloadJSAtOnload, false);
  else if (window.attachEvent)
   window.attachEvent("onload", downloadJSAtOnload);
  else window.onload = downloadJSAtOnload;
</script>

26
Frankey, 11.09.2014 22:23




edit
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction()
{
   alert("Page is loaded");
}
</script>
</head>

<body onload="myFunction()">
<h1>Hello World!</h1>
</body>    
</html>

35
Aamir Shahzad, 26.03.2013 11:39




edit
<body onload="myFunction()">

33
Hakan KOSE, 29.04.2013 14:32




edit
document.onreadystatechange = function(){
     if(document.readyState === 'complete'){
         /*code here*/
     }
}

32
Arthur, 11.09.2014 14:41




edit
YAHOO.util.Event.onDOMReady(function(){
    //your code
});
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo/yahoo-min.js" ></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/event/event-min.js" ></script>

30
Valentin Jacquemin, 30.04.2009 20:36




edit
window.onload = function(){ doSomethingCool(); };
window.onload = function(){ setTimeout( function(){ doSomethingCool(); }, 1000); };

29
ekostadinov, 21.07.2013 00:13

Add your just only code

your name:    



If you need full text click here

Some similar links that executes after page load ↓:
In JavaScript, what code executes at runtime and what code executes at parsetime?

Load content from external page into another page using Ajax/jQuery

GoogleMaps does not load on page load

How to stop page load in html static page



This project is created for those who just need only code, wihout maaaaaaaaaaany words.