问题描述
在我的网站中,我有一个链接,我正在努力工作。我有一个链接,遵循正常的格式,href,以www.youtube.com作为目标链接,最后是target = _blank。当我点击链接时,托管我网站的网站会出现一条错误消息。当我复制并粘贴实际链接时,我会在最后看到我的网页:
www.example.com/www.youtube.com
这不是我想要的!我希望它能够将用户直接带到www.youtube.com的新标签中。任何帮助?
顺便说一句,我输入的实际代码不起作用,所以如果有人想看代码,请在评论中给我你的电子邮件,我会发送给你。感谢您的帮助!
这个问题,就像@Interrobang所说的(尽管不是那么多的话),是完整的在URL的开头缺少 http://
。留下这部分内容,或者更重要的是 //
,可以让浏览器将网址视为相对于网站而言,而不是另一个网站。
In my website, I have a link that I'm trying to get work. I have a link that follows the normal format, a href, with www.youtube.com as the target link, and target=_blank at the end. When I click on the link, the website that hosts my website comes up with an error message. When I copy and paste the actual link, I get my webpage with that at the end:
www.example.com/www.youtube.com
Which is not what I want! I want it to take the user straight to www.youtube.com in a new tab. Any help?
BTW, the actual code I had entered wasn't working, so if anyone wants to see the code, give me your email in the comments and I will send it to you. Thanks for the help!
The problem, as @Interrobang has stated(although not in so many words), is your complete lack of http://
at the beginning of the url. Leaving this part out, or more importantly the //
, makes the browser treat the url as relative to the site, rather than another site altogether.
这篇关于在我的网站上打开链接不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!