How to open image links in new window with window.location

Darshak Shah

I have added following code in wordpress to hide status bar. It works but I want to open link in new window. How can I do that?

<img style='cursor:pointer;' src='http://www.killerpreseller.com/images2/buynow.gif' onclick="window.location='http://www.yahoo.com'"/>
onepointsixtwo

You can use:

window.open('http://www.killerpreseller.com/images2/buynow.gif', '_blank');

As per How to simulate target="_blank" in JavaScript

This is the equivalent of an anchor tag with target='blank' set.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Open links in new window

From Dev

How to open links in a new tab/window using CSS?

From Dev

PhantomJS + Selenium , How to se user agent for links that open in new window?

From Dev

How to set the default for links to open in a new window in NicEdit

From Dev

Mac - how to open new links in a designated chrome window?

From Dev

Image map new window open

From Dev

Emacs and eww, open links in new window?

From Dev

Open primefaces tagcloud links in a new window

From Dev

Torrent magnet links open new window but not transmission

From Dev

Torrent magnet links open new window but not transmission

From Dev

Open all external links in new window

From Dev

Make links open new window in specified terminal

From Dev

window.location Open in a new tab

From Dev

window.location open in new tab

From Dev

Android WebView links to same window with target=_blank to open new window

From Dev

How to open the url in new window?

From Dev

How To Open a Video in a New Window

From Dev

PyQT: how to open new window

From Dev

How to open textarea in new window?

From Dev

How to open the url in new window?

From Dev

how to open a hyperlink in new window

From Dev

Open new window in a new window

From Dev

How to make my links open a 'popup' window

From Dev

open external links in modal instead of new tab or new window

From Dev

Open image to print in new window using jQuery

From Dev

Open image in a new window using Razor and javascript

From Dev

Javascript: open background image in new window

From Dev

HTML open new window on image onclick

From Dev

How to open new window instead of already open window in gnome

Related Related

HotTag

Archive