---
title: "Display alert on window load in Javascript"  
description: "Display alert on window load in Javascript"  
author: "Anonymous User"  
published: 2011-02-28  
updated: 2011-10-11  
canonical: https://www.mindstick.com/forum/175/display-alert-on-window-load-in-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# Display alert on window load in Javascript

Hi,\
\
I want to display [alert](https://answers.mindstick.com/qa/30927/what-is-an-alert) [message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net) on [client side](https://www.mindstick.com/forum/160418/what-are-the-best-practices-for-securely-storing-bearer-tokens-on-the-client-side) as soon as [window](https://www.mindstick.com/forum/161285/how-does-the-window-console-object-work-in-javascript) loads.\
Please help, its urgent.\
\
Waiting for working solution.

## Replies

### Reply by Amit Singh

hi all,\
\
another way to call the function on body load,\
for example\

```
<html><head><script>function show()    {    alert("show alert");    }    </script></head><body onload="show()"></body></html>
```

### Reply by Anonymous User

Hi Chris,\
\
You can display alert box on window load event.\
\

```
window.onload = function () {
       alert('Welcome!');
}
```


---

Original Source: https://www.mindstick.com/forum/175/display-alert-on-window-load-in-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
