title: How to call $(window).on("load", function) in jQuery-3.3.1?
body: <p>I just now started using jquery-3.3.1, and my onload(); function not working anymore. I know this is updated, so I changed the <code>window.onload = function(e)</code> to <code>$(window).on("load", function (e)</code>, but not working... Whats the wrong with this code? How can I call the load function now?</p>
  
  <pre><code>$(window).on("load", function (e) {
      var videoSource = new Array();
  
       videoSource[0] = 'video1.mp4';
       videoSource[1] = 'video2.mp4';
  
  var i = 1; // define i
  var videoCount = videoSource.length;
  
  function videoPlay(videoNum) {
  document.getElementById("myVideo").setAttribute("src", videoSource[videoNum]);
  document.getElementById("myVideo").load();
  document.getElementById("myVideo").play();
  }
  document.getElementById('myVideo').addEventListener('ended', myHandler, false);
  videoPlay(0); // play the video
  
  function myHandler() {
      i++;
      if (i == (videoCount - 1)) {
          i = -1;
          videoPlay(0);
      } else {
          i = 0;
          videoPlay(1);
      }
  }
  })
  </code></pre>
  
  <p>and this is my html:</p>
  
  <pre><code>&lt;video playsinline autoplay muted id="myVideo" type="video/mp4" onload="onload();" poster="poster.png"&gt;&lt;/video&gt;
  </code></pre>
  
  <p>SOLVED: the problem originate from that, I use this <code>window.onload = function()</code> before an (or the?) <code>$(document).ready(function()</code> ... Sorry guys, I am very in javascript, just now learning the basics of this language. Now works the all your solutions, thank you very much all your replies!</p>