onLoad function added.

I needed a callback when the button was clicked and window was loaded.