Using the following snippet, you will be able to simulate a view of a page with JavaScript onclick.

Snippet Source/Credit: Reiffs.dk