javascript - 尝试链接到外部网站

标签 javascript html

<html>
<body>
<a href = "www.google.com" target = "blank_">google</a>
</body>
<html>

我得到的内容:www.mysite.com/www.google.com

我想要得到的:www.google.com/

最佳答案

您需要在 URL 开头添加 http://

<html>
<body>
 <a href = "http://www.google.com" target = "blank_">google</a>
</body>
<html>

关于javascript - 尝试链接到外部网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42939073/

相关文章:

html - 使用 Supersized 跨不同分辨率调整背景图像大小/加载

javascript - 将 Canvas 内脚本生成的图像替换为常用的 jpeg

javascript - Fabrics - 如何在鼠标松开之前渲染自由绘图内容

javascript - AngularJS ng-class 在使用对象数组时添加 [object Object] 类

Javascript 获取两个特定工作日之间的工作日

javascript - 是否有 Math.pow(x, 0) 不为 1 的 `x` 值?

javascript - 全局变量混淆 : var a vs window. a

python - 如何从 <br/> 标签后的单元格中获取文本?

javascript - 浏览器自动下载PHP文件

javascript - 选择表单的 jQuery 重置无法正常工作