gpt4 book ai didi

javascript - 在新标签页中打开新链接

转载 作者:行者123 更新时间:2023-11-30 08:03:47 25 4
gpt4 key购买 nike

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.

enter image description here

And the error page shown below,

enter image description here

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>

最佳答案

如果您不指定 http://,在这种情况下,标准是采用您网站的路径 localhost:8080..
试试这个:

<a href="http://www.yahoo.com" target="_blank">Click Me</a>

或者这个:

window.open("http://www.yahoo.com", "_blank");

关于javascript - 在新标签页中打开新链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21647774/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com