为什么我的锚点 href 路径附加到 URL?
Why is my anchor href path, appending to the URL?
我对自己所处的以下情况感到非常困惑,说实话,我不知道为什么会出现以下情况,也不知道如何解决这个问题。
这是正在发生的事情;
我有以下主播;
<a href=”https://www.google.com/intl/en/policies/terms”
rel="nofollow"
target="_blank">
Terms
</a>
如果用户单击此锚点,则会产生以下结果 URL:
https://www.example.com/contact/"https:/policies.google.com/terms
当然,我希望加载以下 URL;
https://policies.google.com/terms
起初我认为这可能是某处的语法错误,所以拉锚并检查了代码。我在任何地方都看不到任何错误。从那里,我测试了页面中的其他链接。 (一切正常。)所以我想'well if they are working, maybe it was a typo in the code?',我重写了锚点,但同样的问题仍然存在(奇怪)。
所以我的第二个想法是 URL 一定很奇怪,所以我使用了几个替代品,
www.google.com
、www.youtube.com
和 www.facebook.com
。所有 URL 的结果相同。目标 href=""
是否只是附加到 URL?
我没有对我的 URL 或 JavaScript 做任何花哨的事情,为什么会这样?有没有人遇到过这个?或者也许更好的问题是:如何调试这样的东西?
您使用了不正确的双引号。仔细查看下面的 HTML 标签:
<p class="text-muted">We'll get back to you within 1-2 business days.</p>
<p class="small text-muted">(This site is protected by reCAPTCHA and the <br>Google
<a href=”https://www.google.com/intl/en/policies/privacy” rel="nofollow" target="_blank">Privacy Policy</a> and
<a href=”https://www.google.com/intl/en/policies/terms” rel="nofollow" target="_blank">Terms of Service</a> apply.)</p>
p
标签中使用的引号是"
,它与a
标签中使用的引号不同,是”
.
您需要将其替换为"
。
<p class="text-muted">We'll get back to you within 1-2 business days.</p>
<p class="small text-muted">(This site is protected by reCAPTCHA and the <br>Google
<a href="https://www.google.com/intl/en/policies/privacy" rel="nofollow" target="_blank">Privacy Policy</a> and
<a href="https://www.google.com/intl/en/policies/terms" rel="nofollow" target="_blank">Terms of Service</a> apply.)</p>
我对自己所处的以下情况感到非常困惑,说实话,我不知道为什么会出现以下情况,也不知道如何解决这个问题。
这是正在发生的事情;
我有以下主播;
<a href=”https://www.google.com/intl/en/policies/terms”
rel="nofollow"
target="_blank">
Terms
</a>
如果用户单击此锚点,则会产生以下结果 URL:
https://www.example.com/contact/"https:/policies.google.com/terms
当然,我希望加载以下 URL;
https://policies.google.com/terms
起初我认为这可能是某处的语法错误,所以拉锚并检查了代码。我在任何地方都看不到任何错误。从那里,我测试了页面中的其他链接。 (一切正常。)所以我想'well if they are working, maybe it was a typo in the code?',我重写了锚点,但同样的问题仍然存在(奇怪)。
所以我的第二个想法是 URL 一定很奇怪,所以我使用了几个替代品,
www.google.com
、www.youtube.com
和 www.facebook.com
。所有 URL 的结果相同。目标 href=""
是否只是附加到 URL?
我没有对我的 URL 或 JavaScript 做任何花哨的事情,为什么会这样?有没有人遇到过这个?或者也许更好的问题是:如何调试这样的东西?
您使用了不正确的双引号。仔细查看下面的 HTML 标签:
<p class="text-muted">We'll get back to you within 1-2 business days.</p>
<p class="small text-muted">(This site is protected by reCAPTCHA and the <br>Google
<a href=”https://www.google.com/intl/en/policies/privacy” rel="nofollow" target="_blank">Privacy Policy</a> and
<a href=”https://www.google.com/intl/en/policies/terms” rel="nofollow" target="_blank">Terms of Service</a> apply.)</p>
p
标签中使用的引号是"
,它与a
标签中使用的引号不同,是”
.
您需要将其替换为"
。
<p class="text-muted">We'll get back to you within 1-2 business days.</p>
<p class="small text-muted">(This site is protected by reCAPTCHA and the <br>Google
<a href="https://www.google.com/intl/en/policies/privacy" rel="nofollow" target="_blank">Privacy Policy</a> and
<a href="https://www.google.com/intl/en/policies/terms" rel="nofollow" target="_blank">Terms of Service</a> apply.)</p>