【问题标题】:Attribute cf-hash not allowed on element script at this point in validator W3此时在验证器 W3 中元素脚本上不允许属性 cf-hash
【发布时间】:2014-12-29 01:06:46
【问题描述】:

当我在W3C validator 中检查我的网站时,我收到此错误:“此时元素脚本上不允许使用属性 cf-hash”。

这是我的网站源代码:

<a href="/cdn-cgi/l/email-protection#71121003141403311a140210051e5f121e1c" itemprop="email" class="last-link"><span class="__cf_email__" data-cfemail="2b484a594e4e596b404e584a5f4405484446">[email&#160;protected]</span><script cf-hash='f9e31' type="text/javascript">,

【问题讨论】:

  • 嗨,Nathan,CloudFlare 已经承认这是由他们的电子邮件混淆解决方案引起的问题,并建议我在他们修复之前关闭它。 i.imgur.com/4j0DZDG.png

标签: html html-validation


【解决方案1】:

错误消息告诉您需要知道的一切:script 元素不能有 cf-hash 属性。允许的属性在specification of the script element 中列出。

如果您需要自定义属性,请使用 data-* attributes(就像您在 a 元素上使用它们一样):

<script data-cf-hash="f9e31" type="text/javascript">

【讨论】:

  • 是的。但是 cf-hash 属性是由 Cloudflare 的 DNS 系统添加的,通常是由于它们的电子邮件保护功能。我会在推特上发给他们,希望能引起人们对这个问题的关注。
  • Cloudflare 已经承认了这个问题,并建议我关闭电子邮件混淆,直到他们修复它,这可能需要一些时间。 i.imgur.com/4j0DZDG.png
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-04-07
  • 2013-12-21
  • 1970-01-01
  • 2014-01-09
  • 2018-08-28
  • 2017-08-18
相关资源
最近更新 更多