Update sample page

Moved contentWindow inside the event handler