In a tabbed browser (FF 3.5 in for me), I often open links in new tabs with CTRL-click or middle-click. When the link contains a Javascript function, either:
- A blank new tab opens with
javascript:window.print()
or what-have-you in the address bar. - The function executes successfully and a blank new tab opens.
Thing is, this doesn't seem to happen consistently for all Javascript functions. For example:
- The "Print" button on this page, when CTRL-clicked, opens a print dialogue and generates an empty new tab.
- The Whitepaper links on this page, when CTRL-clicked, only generates an empty new tab.
The links in question contain the following code, respectively:
javascript:window.print();
javascript:_hbRedirect('PDF Downloads','White Paper','URL.pdf','&c1=TITLE|US-en')
This SO question is somewhat similar. The best-rated answer details an AJAX-based solution, but I could not find an explanation for why some Javascript functions behave differently with tabs than others.