Reputation: 2214
Hi I am working on j2ee web application. But I am facing one problem when I am trying to open clicked new link in new tab. As if it is opening new tab but it is appending url link over my web application root context path.
My web page where I am clicking.
And the error page shown below,
As you can see I am able to open new tab but problem is it link is appended with root path shown by yellow color.
I tried this by this code,
window.open("www.yahoo.com", "_blank");
also tried using,
<a href="www.yahoo.com" target="_blank">Click Me</a>
Upvotes: 1
Views: 1483
Reputation: 626
target="_blank"
This is the code to say the link should be opened in a blank page.
Upvotes: 0
Reputation: 195952
if you do not specify a protocol then it is assumed to be a local address (local to your website)
So use http://
at the start..
Upvotes: 2
Reputation: 35963
if you don't specify http://
the standard is to take the path of your site in this case localhost:8080
..
try this:
<a href="http://www.yahoo.com" target="_blank">Click Me</a>
or this:
window.open("http://www.yahoo.com", "_blank");
Upvotes: 4