jQuery 词云验证错误

标签 jquery css html rel

请帮忙!:) 我在尝试验证 (HTML5) jQuery 词云时遇到问题。

我收到了所有相关值的信息: “元素 a 上属性 rel 的错误值 1:不是绝对 IRI。字符串 1 不是注册关键字或绝对 URL。”

我还应该在 jQuery 中做哪些修改?![在此处输入图片描述][1]

  <div id="tagcloud">
    <a class="pointOne" rel="0.1" href="http://www.text.dk/" target="_blank">Text</a>
    <a class="two" rel="2" href="http://www.text.dk/" target="_blank">Text</a>
    <a class="three" rel="3" href="http://www.text.dk/" target="_blank">Text</a>
    <a class="four" rel="4" href="http://www.text.dk/" target="_blank">Text</a>
    <a class="five"rel="5" href="http://www.text.dk/" target="_blank">Text</a>
        <a class="six" rel="6" href="http://www.text.dk/" target="_blank">Text</a>
        <a class="seven" rel="7" href="http://www.text.dkk" target="_blank">Text</a>
        <a class="eight" rel="8" href="http://www.text.dk/" target="_blank">Text</a>
        <a class="five" rel="5" href="http://www.text.dk/" target="_blank">Text</a>
        <a class="seven" rel="7" href="http://www.text.dk/" target="_blank">Text</a>
        <a class="three" rel="3" href="http://www.text.dk/" target="_blank">Text </a>
        <a class="one" rel="1" href="http://www.text.dk/">Text</a>
        <a class="twelve"rel="12" href="http://www.text.dk/">Text</a>
        <a class="one" rel="1" href="http://www.text.dk/">Text</a>
        <a class="two" rel="2" href="http://www.text.dk/">Text</a>
        <a class="five" rel="5" href="http://www.text.dk/">Text</a>
        <a class="seven" rel="7" href="http://www.text.dk/">Text</a>
        <a class="one" rel="1" href="http://www.text.dk/">Text</a>
        <a class="four" rel="4" href="http://www.text.dk/">Text</a>
        <a class="one" rel="1" href="http://www.text.dk/">Text</a>
        <a class="two" rel="2" href="http://www.text.dk/">Text</a>

  </div>

最佳答案

号码 aren't valid values对于 rel 属性:

This attribute names a relationship of the linked document to the current document. The attribute must be a space-separated list of the link types values. The most common use of this attribute is to specify a link to an external style sheet: the rel attribute is set to stylesheet, and the href attribute is set to the URL of an external style sheet to format the page.

可接受 link type values是:alternatearchivesauthorbookmarkexternal first, help, icon, index, last, license , next, nofollow, noreferrer, pingback, prefetch, prev searchstylesheetsidebartagup .

我建议你使用 custom data attribute相反,例如:

<a class="one" data-rel="1" href="http://www.text.dk/">Text</a>

然后相应地修改您的 JavaScript,以从 data-rel(或您想要的任何名称)而不是 rel 中获取值。

关于jQuery 词云验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14989574/

相关文章:

jquery - 修改JQuery滑动面板例程

javascript - 每个不封装 block

javascript - 数据处理时显示弹出窗口

html - 无论内容多少,如何使我的侧边栏与页脚对齐?

javascript - 子对象的自定义确认对话框回调

javascript - jQuery 获取多个属性

jquery - 在 Kendo Combobox 上设置背景颜色会删除绑定(bind)

asp.net - 防止 ASP.NET 主题自动添加 CSS 文件

html - Border-Radius 在电子邮件和浏览器中不起作用

javascript - 延迟表单提交和显示重定向覆盖div