Using window.open Within a Link’s href Attribute
Sometimes however, if using a CMS for example, the onclick option of a link is not accessible and all you have access to is the ‘href’ attribute. Placing the window.open() function as a link’s href as follows will open the new window but will result in the parent window showing ‘[object Window]’:
To avoid this parent page redirection we need to modify our href slightly:
The ‘void’ operator we’ve added evaluates the given expression and then returns undefined preventing it from doing anything once the new window has been executed.