Automatically open popup window | modal on page load. To create an auto popup window or modal you need to know about the javascript setTimeout function, this function call another function automatically after a fixed defined time. In this post, I will describe all the steps you need to follow to create an auto popup window or modal in javascript. I also provide you source code so that you can easily create an auto popup window or modal in javascript