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.
문제
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'"/>
해결책 2
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.
다른 팁
Use an anchor with target '_blank'
wrapping your image
<a href='http://www.killerpreseller.com/images2/buynow.gif' target='_blank'>
<img style='cursor:pointer;' src='http://www.killerpreseller.com/images2/buynow.gif' />
</a>