« Home



JavaScript and Window Events: Onload and Onresize Examples

Sometimes your web projects need to be able to detect and act upon certain events. Two common events are the ONLOAD, and ONRESIZE events. Here are some examples showing how to capture when a user triggers them, and how to act on them using a JavaScript function.

These particular examples will alter some text on the page to indicate when the event is detected and return details observable via DOM interfaces.

As this type of widget has become more popularly requested of late, I thought I'd share. Your feedback is appreciated.

Welcome. This text is the default text inside of an HTML DIV container. Additionally data will be presented here as targeted events are detected.

You browser's initial screen width (in pixels) is detected to be





« Home