<分区>
标签 javascript html css
<分区>
所以我遇到了一个非常令人困惑的问题。
当我使用这行代码时:
<li><a href="www.google.com" style="margin-right: 40px;">Donate</a></li>
网站“www.google.com”在我的窗口或标签页中打开,网址为:https://gyazo.com/6f200273b542d4f91e202a85bc3bc725
如果我添加它会做同样的事情
target="_blank"
还有代码
有什么建议吗?
最佳答案
正如上面评论中提到的,您需要 https://
<li>
<a href="www.google.com" style="margin-right: 40px;">without https</a>
</li>
<li>
<a href="https://www.google.com" style="margin-right: 40px;">with https</a>
</li>
<li>
<a href="https://www.google.com" target="_Blank" style="margin-right: 40px;">https with target blank</a>
</li>
关于javascript - 在我的网站内打开外部链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41204832/