资讯专栏INFORMATION COLUMN

前端面试题-HTML语义化标签

wendux / 3019人阅读

摘要:一语义化标签标签描述页面独立的内容区域。二语义化标签的使用页面主要内容标签的特点是简短描述性唯一,用于提升搜索引擎排名。若使用标签来定义计算机源代码,比如源代码,则使用符号实体来表示特殊字符,比如代表,代表,代表。

一、HTML5语义化标签
标签 描述
页面独立的内容区域。
页面的侧边栏内容。
允许您设置一段文本,使其脱离其父元素的文本方向设置。
命令按钮,比如单选按钮、复选框或按钮
用于描述文档或文档某个部分的细节
对话框,比如提示框
标签包含 details 元素的标题
规定独立的流内容(图像、图表、照片、代码等等)。
元素的标题
section 或 document 的页脚。
文档的头部区域
带有记号的文本。
度量衡。仅用于已知最大和最小值的度量。
导航链接的部分。
任何类型的任务的进度。
ruby 注释(中文注音或字符)。
字符(中文注音或字符)的解释或发音。
在 ruby 注释中使用,不支持 ruby 元素的浏览器所显示的内容。
文档中的节(section、区段)。
日期或时间。
规定在文本中的何处适合添加换行符。
二、语义化标签的使用 2.1 页面主要内容

(1) 标签的特点是简短、描述性、唯一,用于提升搜索引擎排名。</p> <p>(2)搜索引擎会把 title 作为判断页面<strong>主要内容</strong>的指标,有效的 title 应该包含几个与页面<strong>内容密切相关</strong>的关键字,建议将 title 的核心内容写在前 <strong>60</strong> 个字符。</p> <b>2.2 <header></header> 页眉</b> <p>(1)HTML5 规范描述为“<strong>一组解释性或导航型性的条目</strong>”,通常有网站标志、主导航、全站链接以及搜索框。</p> <b>2.3 <nav></nav> 导航</b> <p>(1)页面的导航链接区域,用于定义页面的主要<strong>导航</strong>部分。</p> <p>(2)导航通常使用 <strong><ul></strong> 无序列表。若是面包屑链接,则使用 <strong><ol></strong> 有序列表。</p> <p>(3)HTML5 规范不推荐对辅助页脚链接使用 nav,除非页脚再次显示顶级全局导航、或者是招聘信息等重要链接。</p> <b>2.4 <main></main> 主要内容</b> <p>(1)网站页面的<strong>主要内容</strong>,并且一个页面只能使用<strong>一次</strong> <main> 标签。</p> <p>(2)若是 web 应用,则包含其主要功能。</p> <b>2.5 <article></article> 文章标记</b> <p>(1)表示的是一个文档、页面、应用或是网站中的一个<strong>独立</strong>的容器。</p> <p>(2)HTML5 规范声明 <article> 标签适用于自包含的窗口小部件:股票行情,计算器,钟表,天气窗口小部件等。</p> <p>(3)<article>这个标签可以<strong>嵌套</strong>使用,但是他们必须是<strong>部分与整体的关系</strong>。</p> <b>2.6 <section></section> 区块</b> <p>(1)一组<strong>相似主题</strong>的内容,一般会有一个标题。</p> <p>(2)实现比如文章的章节,标签式对话框中的各种标签页等功能。</p> <b>2.7 <aside></aside> 侧边栏</b> <p>(1)表示一部分内容与页面的主体并没有较大的关系,并且可以<strong>独立存在</strong>。</p> <p>(2)实现比如升式引用、侧边栏、相关文章的链接、广告、友情链接等功能。</p> <b>2.8 <footer></footer> 页脚</b> <p>(1)和 <header> 标签对应,可以实现比如附录、索引、版权页、许可协议等功能。</p> <b>2.9 <cite></cite> 引用</b> <p>(1)表示它所包含的文本对某个参考文献的<strong>引用</strong>,比如书籍或者杂志的标题。</p> <p>(2)按照惯例,引用的文本将以<strong>斜体</strong>显示。</p> <p>(3)用 <cite> 标签把指向其他文档的引用<strong>分离</strong>出来,尤其是分离那些传统媒体中的文档,如书籍、杂志、期刊,等等。</p> <b>2.10 <blockquote></blockquote> 块引用</b> <p>(1)<blockquote> 与 </blockquote> 之间的所有文本都会从常规文本中分离出来,经常会在左、右两边进行缩进<strong>(增加外边距)</strong>,而且有时会使用斜体。也就是说,块引用拥有它们自己的空间。</p> <b>2.11 <q></q> 短的引用</b> <p>(1)浏览器经常在引用的内容周围添加引号。</p> <p>(2)根据 HTML 4.01 规范,q 元素应当使用分界引号来呈现,就是说,q 元素包含的文本必须以<strong>引号</strong>来开始和结束。</p> <b>2.12 <time></time> 日期或时间</b> <p>(1)如果<strong>未定义</strong> datetime 属性,则必须在元素的内容中规定日期或时间。</p> <b>2.13 <abbr></abbr> 简称或缩写</b> <p>(1)通过对缩写进行标记,您能够为浏览器、拼写检查和搜索引擎提供有用的信息。</p> <p>(2)可以在 <abbr> 标签中使用全局的 <strong>title</strong> 属性,这样就能够在鼠标指针移动到 <abbr> 元素上时显示出简称/缩写的<strong>完整版本</strong>。</p> <b>2.14 <dfn></dfn> 特殊术语或短语的定义</b> <p>(1)现在流行的浏览器通常用<strong>斜体</strong>来显示 <dfn> 中的文本。</p> <p>(2)与其他许多基于内容的样式和物理样式标签一样,<dfn> 标签尽量<strong>少用</strong>为妙。</p> <b>2.15 <b><del></del></b> 删除的文本</b> <p>(1)和 <ins> 标签配合使用,来描述文档中的<strong>更新</strong>和<strong>修正</strong>。</p> <b>2.16 <ins></ins> 插入文本</b> <b>2.17 <b><code></code></b> 源代码</b> <p>(1)用于表示计算机<strong>源代码</strong>或者其他机器可以阅读的文本内容。</p> <b>2.18 <pre></pre> 预格式化的文本</b> <p>(1)被包围在 pre 元素中的文本通常会<strong>保留空格和换行符</strong>。而文本也会呈现为等宽字体。</p> <p>(2)若使用 <pre> 标签来定义计算机源代码,比如 HTML 源代码,则使用<strong>符号实体</strong>来表示特殊字符,比如 "<" 代表 "<",">" 代表 ">","&" 代表 "&"。</p> <p>(3)可以导致<strong>段落断开</strong>的标签(例如标题、<p> 和 <address> 标签)绝不能包含在 <pre> 所定义的块里。尽管有些浏览器会把段落结束标签解释为简单地换行,但是这种行为在所有浏览器上并不都是一样的。</p> <p>(4)pre 元素中允许的文本可以包括物理样式和基于内容的样式变化,还有链接、图像和水平分隔线。</p> <p>阅读更多</p> </div> <div class="mt-64 tags-seach" > <div class="tags-info"> <a style="width:120px;" title="超融合服务器" href="https://www.ucloud.cn/site/product/utrion.html">超融合服务器</a> <a style="width:120px;" title="服务器托管" href="https://www.ucloud.cn/site/product/uhybrid.html">服务器托管</a> <a style="width:120px;" title="html 标签语义化" href="https://www.ucloud.cn/yun/tag/html biaoqianyuyihua/">html 标签语义化</a> <a style="width:120px;" title="标签语义化" href="https://www.ucloud.cn/yun/tag/biaoqianyuyihua/">标签语义化</a> <a style="width:120px;" title="html面试题" href="https://www.ucloud.cn/yun/tag/htmlmianshiti/">html面试题</a> <a style="width:120px;" title="语义化" href="https://www.ucloud.cn/yun/tag/yuyihua/">语义化</a> </div> </div> <div class="entry-copyright mb-30"> <p class="mb-15"> 文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。</p> <p>转载请注明本文地址:https://www.ucloud.cn/yun/115856.html</p> </div> <ul class="pre-next-page"> <li class="ellipsis"><a class="hpf" href="https://www.ucloud.cn/yun/115855.html">上一篇:【干货】十分钟读懂浏览器渲染流程</a></li> <li class="ellipsis"><a class="hpf" href="https://www.ucloud.cn/yun/115857.html">下一篇:整理css之BFC原理</a></li> </ul> </div> <div class="about_topicone-mid"> <h3 class="top-com-title mb-0"><span data-id="0">相关文章</span></h3> <ul class="com_white-left-mid atricle-list-box"> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/115862.html"><b><em>前端</em><em>面试</em><em>题</em>-<em>HTML</em>结构<em>语义</em><em>化</em></b></a></h2> <p class="ellipsis2 good">摘要:一语义化的背景结构语义化,是近几年才提出来的,对比之前的结构,大多是一堆没有语义的标签。用的最多的就是,为了改变这种现状,开发者们和官方提出了结构语义化的概念,并且在添加了很多语义化标签。 一、HTML语义化的背景 HTML结构语义化,是近几年才提出来的,对比之前的 HTML 结构,大多是一堆没有语义的标签。用的最多的就是 DIV+CSS,为了改变这种现状,开发者们和官方提出了 HTM...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-1460.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/14/small_000001460.jpg" alt=""><span class="layui-hide64">chuyao</span></a> <time datetime="">2019-08-30 14:13</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/52042.html"><b><em>前端</em><em>面试</em><em>题</em>-<em>HTML</em>结构<em>语义</em><em>化</em></b></a></h2> <p class="ellipsis2 good">摘要:一语义化的背景结构语义化,是近几年才提出来的,对比之前的结构,大多是一堆没有语义的标签。用的最多的就是,为了改变这种现状,开发者们和官方提出了结构语义化的概念,并且在添加了很多语义化标签。 一、HTML语义化的背景 HTML结构语义化,是近几年才提出来的,对比之前的 HTML 结构,大多是一堆没有语义的标签。用的最多的就是 DIV+CSS,为了改变这种现状,开发者们和官方提出了 HTM...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-832.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/08/small_000000832.jpg" alt=""><span class="layui-hide64">booster</span></a> <time datetime="">2019-08-01 18:43</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/60476.html"><b><em>前端</em><em>面试</em><em>题</em>-<em>HTML</em>结构<em>语义</em><em>化</em></b></a></h2> <p class="ellipsis2 good">摘要:一语义化的背景结构语义化,是近几年才提出来的,对比之前的结构,大多是一堆没有语义的标签。用的最多的就是,为了改变这种现状,开发者们和官方提出了结构语义化的概念,并且在添加了很多语义化标签。 一、HTML语义化的背景 HTML结构语义化,是近几年才提出来的,对比之前的 HTML 结构,大多是一堆没有语义的标签。用的最多的就是 DIV+CSS,为了改变这种现状,开发者们和官方提出了 HTM...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-14.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/00/small_000000014.jpg" alt=""><span class="layui-hide64">617035918</span></a> <time datetime="">2019-08-05 18:04</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/52061.html"><b><em>前端</em><em>面试</em><em>题</em>-<em>HTML</em><em>语义</em><em>化</em><em>标签</em></b></a></h2> <p class="ellipsis2 good">摘要:一语义化标签标签描述页面独立的内容区域。二语义化标签的使用页面主要内容标签的特点是简短描述性唯一,用于提升搜索引擎排名。若使用标签来定义计算机源代码,比如源代码,则使用符号实体来表示特殊字符,比如代表,代表,代表。 一、HTML5语义化标签 标签 描述 页面独立的内容区域。 页面的侧边栏内容。 允许您设置一段文本,使其脱离其父元素的文本方向设置。 命令按钮...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-745.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/07/small_000000745.jpg" alt=""><span class="layui-hide64">cppowboy</span></a> <time datetime="">2019-08-01 18:43</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/60468.html"><b><em>前端</em><em>面试</em><em>题</em>-<em>HTML</em><em>语义</em><em>化</em><em>标签</em></b></a></h2> <p class="ellipsis2 good">摘要:一语义化标签标签描述页面独立的内容区域。二语义化标签的使用页面主要内容标签的特点是简短描述性唯一,用于提升搜索引擎排名。若使用标签来定义计算机源代码,比如源代码,则使用符号实体来表示特殊字符,比如代表,代表,代表。 一、HTML5语义化标签 标签 描述 页面独立的内容区域。 页面的侧边栏内容。 允许您设置一段文本,使其脱离其父元素的文本方向设置。 命令按钮...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-273.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/02/small_000000273.jpg" alt=""><span class="layui-hide64">piglei</span></a> <time datetime="">2019-08-05 18:04</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> </ul> </div> <div class="topicone-box-wangeditor"> <h3 class="top-com-title mb-64"><span>发表评论</span></h3> <div class="xcp-publish-main flex_box_zd"> <div class="unlogin-pinglun-box"> <a href="javascript:login()" class="grad">登陆后可评论</a> </div> </div> </div> <div class="site-box-content"> <div class="site-content-title"> <h3 class="top-com-title mb-64"><span>0条评论</span></h3> </div> <div class="pages"></ul></div> </div> </div> <div class="layui-col-md4 layui-col-lg3 com_white-right site-wrap-right"> <div class=""> <div class="com_layuiright-box user-msgbox"> <a href="https://www.ucloud.cn/yun/u-1559.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/15/small_000001559.jpg" alt=""></a> <h3><a href="https://www.ucloud.cn/yun/u-1559.html" rel="nofollow">wendux</a></h3> <h6>男<span>|</span>高级讲师</h6> <div class="flex_box_zd user-msgbox-atten"> <a href="javascript:attentto_user(1559)" id="attenttouser_1559" class="grad follow-btn notfollow attention">我要关注</a> <a href="javascript:login()" title="发私信" >我要私信</a> </div> <div class="user-msgbox-list flex_box_zd"> <h3 class="hpf">TA的文章</h3> <a href="https://www.ucloud.cn/yun/ut-1559.html" class="box_hxjz">阅读更多</a> </div> <ul class="user-msgbox-ul"> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/124127.html">猿猿有责,维持整洁的 Git 提交记录,三个锦囊送给你</a></h3> <p>阅读 1098<span>·</span>2021-11-22 12:05</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/123026.html">没有这个传奇工程师,就没有今天的Windows</a></h3> <p>阅读 3057<span>·</span>2021-11-11 16:54</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/121523.html">完蛋,公司被一条 update 语句干趴了!</a></h3> <p>阅读 1126<span>·</span>2021-09-29 09:35</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/117127.html">前端常用小工具</a></h3> <p>阅读 471<span>·</span>2019-08-30 15:55</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/115856.html">前端面试题-HTML语义化标签</a></h3> <p>阅读 3020<span>·</span>2019-08-30 14:12</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/115843.html">keystonejs实战之页头页脚</a></h3> <p>阅读 859<span>·</span>2019-08-30 14:11</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/115361.html">纯css icons图标,只使用一个 i 标签</a></h3> <p>阅读 2756<span>·</span>2019-08-30 13:10</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/113818.html">构建静态页面 之 [ 显示和溢出 ]</a></h3> <p>阅读 2296<span>·</span>2019-08-29 16:33</p></li> </ul> </div> <!-- 云社区相关服务 --> <div class="com_layuiright-box"> <h3 class="top-com-title"><span>云社区相关服务</span></h3> <div class="community-box flex_box flex_wrap community-box1"> <a href="https://www.ucloud.cn/yun/question/add.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon1.png" alt="提问"> <span>提问</span> </a> <a href="https://www.ucloud.cn/yun/article" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon2.png" alt="学习"> <span>学习</span> </a> <a href="https://www.ucloud.cn/yun/user/vertify.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon4.png" alt="认证"> <span>认证</span> </a> <a href="https://www.ucloud.cn/site/product/uhost.html?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon5.png" alt="产品"> <span>产品</span> </a> <a href="https://spt.ucloud.cn/30001?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon6.png" alt="技术服务"> <span>技术服务</span> </a> <a href="https://spt.ucloud.cn/30001?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon3.png" alt="售前咨询"> <span>售前咨询</span> </a> </div> </div> <!-- 文章详情右侧广告--> <div class="com_layuiright-box"> <h6 class="top-com-title"><span>最新活动</span></h6> <div class="com_adbox"> <div class="layui-carousel" id="right-item"> <div carousel-item> <div> <a href="https://www.ucloud.cn/site/product/uhost.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/Z7TLrpAi.png" alt="云服务器"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/uhybrid.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/MWraMsBh.png" alt="混合云"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/ucloudstack.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/ifzOxvjW.png" alt="私有云"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/utrion.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/VDqwC1iN.png" alt="超融合服务器"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/uhybrid.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220630/pJwnviKN.png" alt="服务器托管"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/uxzone.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220630/CDb5uXxp.jpeg" alt="idc机房托管"> </a> </div> <div> <a href="https://www.ucloud.cn/site/active/network.html?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/230227/XWsSXmvm.png" alt="专线服务"> </a> </div> </div> </div> </div> <!-- banner结束 --> <div class="adhtml"> </div> <script> $(function(){ $.ajax({ type: "GET", url:"https://www.ucloud.cn/yun/ad/getad/1.html", cache: false, success: function(text){ $(".adhtml").html(text); } }); }) </script> </div> </div> </div> </div> </div> </section> <!-- wap拉出按钮 --> <div class="site-tree-mobile layui-hide"> <i class="layui-icon layui-icon-spread-left"></i> </div> <!-- wap遮罩层 --> <div class="site-mobile-shade"></div> <!--付费阅读 --> <div id="payread"> <div class="layui-form-item">阅读需要支付1元查看</div> <div class="layui-form-item"><button class="btn-right">支付并查看</button></div> </div> <script> var prei=0; $(".site-seo-depict pre").each(function(){ var html=$(this).html().replace("<code>","").replace("</code>","").replace('<code class="javascript hljs" codemark="1">',''); $(this).attr('data-clipboard-text',html).attr("id","pre"+prei); $(this).html("").append("<code>"+html+"</code>"); prei++; }) $(".site-seo-depict img").each(function(){ if($(this).attr("src").indexOf('data:image/svg+xml')!= -1){ $(this).remove(); } }) $("LINK[href*='style-49037e4d27.css']").remove(); $("LINK[href*='markdown_views-d7a94ec6ab.css']").remove(); layui.use(['jquery', 'layer','code'], function(){ $("pre").attr("class","layui-code"); $("pre").attr("lay-title",""); $("pre").attr("lay-skin",""); layui.code(); $(".layui-code-h3 a").attr("class","copycode").html("复制代码 ").attr("onclick","copycode(this)"); }); function copycode(target){ var id=$(target).parent().parent().attr("id"); var clipboard = new ClipboardJS("#"+id); clipboard.on('success', function(e) { e.clearSelection(); alert("复制成功") }); clipboard.on('error', function(e) { alert("复制失败") }); } //$(".site-seo-depict").html($(".site-seo-depict").html().slice(0, -5)); </script> <link rel="stylesheet" type="text/css" href="https://www.ucloud.cn/yun/static/js/neweditor/code/styles/tomorrow-night-eighties.css"> <script src="https://www.ucloud.cn/yun/static/js/neweditor/code/highlight.pack.js" type="text/javascript"></script> <script src="https://www.ucloud.cn/yun/static/js/clipboard.js"></script> <script>hljs.initHighlightingOnLoad();</script> <script> function setcode(){ var _html=''; document.querySelectorAll('pre code').forEach((block) => { var _tmptext=$.trim($(block).text()); if(_tmptext!=''){ _html=_html+_tmptext; console.log(_html); } }); } </script> <script> function payread(){ layer.open({ type: 1, title:"付费阅读", shadeClose: true, content: $('#payread') }); } // 举报 function jupao_tip(){ layer.open({ type: 1, title:false, shadeClose: true, content: $('#jubao') }); } $(".getcommentlist").click(function(){ var _id=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); $("#articlecommentlist"+_id).toggleClass("hide"); var flag=$("#articlecommentlist"+_id).attr("dataflag"); if(flag==1){ flag=0; }else{ flag=1; //加载评论 loadarticlecommentlist(_id,_tid); } $("#articlecommentlist"+_id).attr("dataflag",flag); }) $(".add-comment-btn").click(function(){ var _id=$(this).attr("dataid"); $(".formcomment"+_id).toggleClass("hide"); }) $(".btn-sendartcomment").click(function(){ var _aid=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); var _content=$.trim($(".commenttext"+_aid).val()); if(_content==''){ alert("评论内容不能为空"); return false; } var touid=$("#btnsendcomment"+_aid).attr("touid"); if(touid==null){ touid=0; } addarticlecomment(_tid,_aid,_content,touid); }) $(".button_agree").click(function(){ var supportobj = $(this); var tid = $(this).attr("id"); $.ajax({ type: "GET", url:"https://www.ucloud.cn/yun/index.php?topic/ajaxhassupport/" + tid, cache: false, success: function(hassupport){ if (hassupport != '1'){ $.ajax({ type: "GET", cache:false, url: "https://www.ucloud.cn/yun/index.php?topic/ajaxaddsupport/" + tid, success: function(comments) { supportobj.find("span").html(comments+"人赞"); } }); }else{ alert("您已经赞过"); } } }); }); function attenquestion(_tid,_rs){ $.ajax({ //提交数据的类型 POST GET type:"POST", //提交的网址 url:"https://www.ucloud.cn/yun/favorite/topicadd.html", //提交的数据 data:{tid:_tid,rs:_rs}, //返回数据的格式 datatype: "json",//"xml", "html", "script", "json", "jsonp", "text". //在请求之前调用的函数 beforeSend:function(){}, //成功返回之后调用的函数 success:function(data){ var data=eval("("+data+")"); console.log(data) if(data.code==2000){ layer.msg(data.msg,function(){ if(data.rs==1){ //取消收藏 $(".layui-layer-tips").attr("data-tips","收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart-o"></i>'); } if(data.rs==0){ //收藏成功 $(".layui-layer-tips").attr("data-tips","已收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart"></i>') } }) }else{ layer.msg(data.msg) } } , //调用执行后调用的函数 complete: function(XMLHttpRequest, textStatus){ postadopt=true; }, //调用出错执行的函数 error: function(){ //请求出错处理 postadopt=false; } }); } </script> <footer> <div class="layui-container"> <div class="flex_box_zd"> <div class="left-footer"> <h6><a href="https://www.ucloud.cn/"><img src="https://www.ucloud.cn/yun/static/theme/ukd//images/logo.png" alt="UCloud (优刻得科技股份有限公司)"></a></h6> <p>UCloud (优刻得科技股份有限公司)是中立、安全的云计算服务平台,坚持中立,不涉足客户业务领域。公司自主研发IaaS、PaaS、大数据流通平台、AI服务平台等一系列云计算产品,并深入了解互联网、传统企业在不同场景下的业务需求,提供公有云、混合云、私有云、专有云在内的综合性行业解决方案。</p> </div> <div class="right-footer layui-hidemd"> <ul class="flex_box_zd"> <li> <h6>UCloud与云服务</h6> <p><a href="https://www.ucloud.cn/site/about/intro/">公司介绍</a></p> <p><a href="https://zhaopin.ucloud.cn/" >加入我们</a></p> <p><a href="https://www.ucloud.cn/site/ucan/onlineclass/">UCan线上公开课</a></p> <p><a href="https://www.ucloud.cn/site/solutions.html" >行业解决方案</a></p> <p><a href="https://www.ucloud.cn/site/pro-notice/">产品动态</a></p> </li> <li> <h6>友情链接</h6> <p><a href="https://www.surfercloud.com/">SurferCloud</a></p> <p><a href="https://ucloudstack.com/" >私有云</a></p><p><a href="https://pinex.it" >pinex</a></p> <p><a href="https://www.renyucloud.com/" ></a></p> <p><a href="https://www.picpik.ai" >AI Art Generator</a></p> <p><a href="https://www.uwin-link.com" >工厂仿真软件</a></p> </li> <li> <h6>社区栏目</h6> <p><a href="https://www.ucloud.cn/yun/column/index.html">专栏文章</a></p> <p><a href="https://www.ucloud.cn/yun/ask/">专业问答</a></p> <p><a href="https://www.ucloud.cn/yun/kc.html">云学院</a></p> <p><a href="https://www.ucloud.cn/yun/udata/">专题地图</a></p> </li> <li> <h6>常见问题</h6> <p><a href="https://www.ucloud.cn/site/ucsafe/notice.html" >安全中心</a></p> <p><a href="https://www.ucloud.cn/site/about/news/recent/" >新闻动态</a></p> <p><a href="https://www.ucloud.cn/site/about/news/report/">媒体动态</a></p> <p><a href="https://www.ucloud.cn/site/cases.html">客户案例</a></p> <p><a href="https://www.ucloud.cn/site/notice/">公告</a></p> </li> <li> <span><img src="https://static.ucloud.cn/7a4b6983f4b94bcb97380adc5d073865.png" alt="优刻得"></span> <p>扫扫了解更多</p></div> </div> <div class="copyright">Copyright © 2012-2023 UCloud 优刻得科技股份有限公司<i>|</i><a rel="nofollow" href="http://beian.miit.gov.cn/">沪公网安备 31011002000058号</a><i>|</i><a rel="nofollow" href="http://beian.miit.gov.cn/"></a> 沪ICP备12020087号-3</a><i>|</i> <script type="text/javascript" src="https://gyfk12.kuaishang.cn/bs/ks.j?cI=197688&fI=125915" charset="utf-8"></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?290c2650b305fc9fff0dbdcafe48b59d"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-DZSMXQ3P9N"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-DZSMXQ3P9N'); </script> <script> (function(){ var el = document.createElement("script"); el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?99f50ea166557aed914eb4a66a7a70a4709cbb98a54ecb576877d99556fb4bfc3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window) </script></div> </div> </footer> </body> <script src="https://www.ucloud.cn/yun/static/theme/ukd/js/common.js"></script> <<script type="text/javascript"> $(".site-seo-depict *,.site-content-answer-body *,.site-body-depict *").css("max-width","100%"); </script> </html>