Showing posts with label onload event. Show all posts
Showing posts with label onload event. Show all posts

How do I call a JavaScript function on page load?

In this tutorial learn how to call function of JavaScript while page load/ auto load page.

1. Using  window.onload call the function while page load

<script>
window.onload = function() {
  show_random_number();
};

function show_random_number() {
  var random_number = Math.random(); // generate random number between 0 and 1
  alert(random_number); // show popup with a random number
}
</script>


how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...