使用 Href 打开本地文件 URL
Local file open URL with Href
我有一个文件 .html 在我的计算机上(本地)我只想有一个按钮或一个超链接。
所以我做了这样的事情:
超链接:
<a href="www.google.com" target="_blank">test</a>
按钮:
<button href="www.google.com">test</button>
但它不起作用,因为打开 Url 就像:
file:///C:/Users/Cyril/Documents/visual%20studio%202013/Projects/MyProject/www.google.com
如何打开 www.google.com ?
感谢您的帮助
您的 src
属性中 url 地址前缺少 http
。而不是 www.google.com
你应该 http://www.google.com
正确的超链接:
<a href="http://www.google.com" target="_blank">test</a>
我有一个文件 .html 在我的计算机上(本地)我只想有一个按钮或一个超链接。
所以我做了这样的事情:
超链接:
<a href="www.google.com" target="_blank">test</a>
按钮:
<button href="www.google.com">test</button>
但它不起作用,因为打开 Url 就像: file:///C:/Users/Cyril/Documents/visual%20studio%202013/Projects/MyProject/www.google.com
如何打开 www.google.com ?
感谢您的帮助
您的 src
属性中 url 地址前缺少 http
。而不是 www.google.com
你应该 http://www.google.com
正确的超链接:
<a href="http://www.google.com" target="_blank">test</a>