服务器为何返回HTML代码?

小贝
预计阅读时长 17 分钟
位置: 首页 自媒体运营 正文

HTML基础介绍

HTML(HyperText Markup Language)是一种用于创建网页的标准标记语言,它描述了网页的结构和内容,是构建网页的基础,通过使用HTML标签,可以定义文字、图像、链接、表格等元素,从而组织和展示信息,以下是一些常见的HTML标签及其功能:

描述
定义HTML文档的根元素
包含文档的元数据,如标题、样式表链接等
</code></td><td> 定义网页的标题</td></tr><tr><td><code><body></code></td><td> 包含网页的主体内容</td></tr><tr><td><code><h1><h6></code></td><td> 定义不同级别的标题</td></tr><tr><td><code><center><img src="https://kun123.com/zb_users/upload/post_aigc_pic/category_1/84405be07145444bb21d00c13fd80b1c_0.png" alt="服务器返回html代码"></center><p></code></td><td> 定义段落</td></tr><tr><td><code><a></code></td><td> 定义超链接</td></tr><tr><td><code><img></code></td><td> 嵌入图像</td></tr><tr><td><code><table></code></td><td> 定义表格</td></tr><tr><td><code><tr></code></td><td> 定义表格行</td></tr><tr><td><code><td></code></td><td> 定义表格单元格</td></tr><tr><td><code><ul></code></td><td> 定义无序列表</td></tr><tr><td><code><li></code></td><td> 定义列表项</td></tr><tr><td><code><form></code></td><td> 定义表单</td></tr><tr><td><code><input></code></td><td> 定义输入字段</td></tr><tr><td><code><button></code></td><td> 定义按钮</td></tr><tr><td><code><div></code></td><td> 定义一个区块</td></tr><tr><td><code><span></code></td><td> 定义一个行内元素</td></tr></tbody></table><h2>创建一个简单的HTML页面</h2><p>以下是一个基本的HTML页面示例,展示了如何使用上述标签来构建一个简单但完整的网页:</p><pre class="brush:html;toolbar:false"> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>我的网页</title> <style> body { font-family: Arial, sans-serif; margin: 20px; } h1 { color: #333; } p { color: #666; } </style> </head> <body> <h1>欢迎来到我的网站</h1> <p>这是一个示例网页,用于展示HTML的基本用法。</p> <a href="https://www.example.com">点击这里访问示例网站</a> <img src="image.jpg" alt="示例图片"> <h2>无序列表示例</h2> <ul> <li>项目一</li> <li>项目二</li> <li>项目三</li> </ul> <h2>表格示例</h2> <table border="1"> <tr> <th>姓名</th> <th>年龄</th> <th>性别</th> </tr> <tr> <td>张三</td> <td>25</td> <td>男</td> </tr> <tr> <td>李四</td> <td>22</td> <td>女</td> </tr> </table> </body> </html></pre><h2>HTML表单与输入元素</h2><p>HTML表单用于收集用户输入的数据,并将其发送到服务器进行处理,表单通常由各种输入元素组成,如文本框、复选框、单选按钮和提交按钮,以下是一个基本的HTML表单示例:</p><pre class="brush:html;toolbar:false"> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>注册表单</title> </head> <body> <h1>注册表单</h1> <form action="/submit" method="post"> <label for="username">用户名:</label><br> <input type="text" id="username" name="username"><br><br> <label for="password">密码:</label><br> <input type="password" id="password" name="password"><br><br> <label for="email">电子邮件:</label><br> <input type="email" id="email" name="email"><br><br> <label for="gender">性别:</label><br> <input type="radio" id="male" name="gender" value="male"> <label for="male">男</label><br> <input type="radio" id="female" name="gender" value="female"> <label for="female">女</label><br><br> <label for="bio">自我介绍:</label><br> <textarea id="bio" name="bio" rows="4" cols="50"></textarea><br><br> <button type="submit">注册</button> </form> </body> </html></pre><h2>相关问题与解答</h2><p>问题1:什么是语义化HTML?为什么重要?</p><p><strong>回答:</strong> 语义化HTML是指使用具有明确含义的HTML标签来构建网页,而不是仅仅依赖<code><div></code>和<code><span></code>等通用容器标签,使用<code><header></code>、<code><footer></code>、<code><article></code>、<code><section></code>等标签来表示页面的不同部分,这样做的好处包括:</p><p>提高代码的可读性和可维护性。</p><p>有助于搜索引擎优化(SEO),因为搜索引擎可以更好地理解页面结构。</p><p>增强无障碍访问性,使屏幕阅读器等辅助技术能够更准确地解释页面内容。</p><center><img src="https://kun123.com/zb_users/upload/post_aigc_pic/category_1/84405be07145444bb21d00c13fd80b1c_1.png" alt="服务器返回html代码"></center><p>问题2:如何在HTML中嵌入CSS样式?有几种方法?</p><p><strong>回答:</strong> 在HTML中嵌入CSS样式主要有以下三种方法:</p><p>1、<strong>内联样式</strong>:直接在HTML元素的<code>style</code>属性中编写CSS规则。<code><p style="color: red;">这是红色文字。</p></code>,这种方法适用于简单的样式应用,但不利于代码的重用和维护。</p><p>2、<strong>内部样式表</strong>:在HTML文档的<code><head></code>部分使用<code><style></code>标签定义CSS规则。</p><pre class="brush:html;toolbar:false"> <head> <style> p { color: blue; } </style> </head> ```这种方法适用于单个页面的样式定义,但不适用于多个页面共享样式的情况。 3、<strong>外部样式表</strong>:将CSS规则写在一个独立的<code>.css</code>文件中,然后在HTML文档中使用<code><link></code>标签引入。</pre><p> <head></p><p> <link rel="stylesheet" href="styles.css"></p><p> </head></p><center><img src="https://kun123.com/zb_users/upload/post_aigc_pic/category_1/84405be07145444bb21d00c13fd80b1c_2.png" alt="服务器返回html代码"></center><p> ```这种方法是最推荐的方式,因为它可以实现样式的复用和分离,便于管理和修改。</p><p>以上内容就是解答有关“<strong>服务器返回html代码</strong>”的详细内容了,我相信这篇文章可以为您解决一些疑惑,有任何问题欢迎留言反馈,谢谢阅读。</p></div> </div> <div class="showall">-- 展开阅读全文 --</div> </div> <footer class="sider-footer"> <div class="pos-r clearfix"> <div class="share-box "> <div class="weixin mouh" id="share-weixin" title="微信分享"> <i class="ri-wechat-line"></i> <div class="wx-t-x pos-a hide box" id="weixin-box"> <img class="qrcode fl bor-3" src="https://kun123.com/zb_users/theme/yk_lltx/plugin/api.php?url=https://kun123.com/article/17022.html" alt="二维码"> </div> </div> <span class="dot"></span> <a href="javascript:Share('tqq')" class="qq" title="QQ分享"> <i class="ri-qq-line"></i> </a> <span class="dot"></span> <a href="javascript:Share('sina')" class="weibo" title="微博分享"> <i class="ri-weibo-line"></i> </a> <span class="dot"></span> <a href="javascript:;" class="copy-share-item" title="复制链接"> <i class="ri-file-copy-line"></i> </a> <span class="dot"></span> <!--点赞s--> <span title="点赞" class="izan" id="agree-btn" data-cid="" data-url="https://kun123.com/zb_users/theme/yk_lltx/cmd.php?act=zan&id=17022"> <i class="ri-heart-line"></i> <p class="agree-num">0</p> </span> <!--点赞e--> </div> </div> </footer> <div class="sider-footer-user post_no"> <div class="author-infos" data-id="1"> <img src="https://api.multiavatar.com/HRPxGhbV.png" class="avatar" height="30" width="30" alt="头像"> <div class="author-info-card"></div> </div> </div> <footer class="entry-footer " id="footfix"> <div class="entry-bar-inner"> <div class="post-tags"> <a href="https://kun123.com/tags/1999.html">HTML</a><a href="https://kun123.com/tags/850.html">CSS</a><a href="https://kun123.com/tags/849.html">JavaScript</a> </div> <div class="readlist"> <div href="javascript:;" id="mClick" class="mobile_click"> <div class="share"> <div class="Menu-item"><a href="javascript:Share('tqq')"><i class="ri-qq-line ri-lg"></i> QQ 分享</a></div> <div class="Menu-item"><a href="javascript:Share('sina')"><i class="ri-weibo-line ri-lg"></i> 微博分享</a></div> <div class="Menu-item"> <i class="ri-wechat-line ri-lg"></i> 微信分享<img src="https://kun123.com/zb_users/theme/yk_lltx/plugin/api.php?url=https://kun123.com/article/17022.html" alt="微信扫一扫"> </div> </div> <div> <i class="ri-share-circle-line ri-lg" title="分享转发"> </i>分享 </div> </div> <div class="read_outer"> <a class="comiis_poster_a" href="javascript:;" title="生成封面"><i class="ri-image-line ri-lg"></i> 封面</a> </div> </div> </div> </footer> </article> <!--下一篇上一篇--> <div class="entry-page"> <div class="entry-page-prev j-lazy" style="background-image: url(https://kun123.com/zb_users/cache/thumbs/bf71fb5117836d19c20e37d5e4409a04-210-160-1.png)"> <a href="https://kun123.com/article/17021.html"> <span>如何将服务器设置为RAID阵列?</span> </a> <div class="entry-page-info"> <span class="pull-left">« 上一篇</span> <span class="pull-right">2024-12-11</span> </div> </div> <div class="entry-page-next j-lazy" style="background-image: url(https://kun123.com/zb_users/cache/thumbs/772018726f00d816de0ac7f47f9341b9-210-160-1.png)"> <a href="https://kun123.com/article/17023.html"> <span>如何利用JS特效提升App开发体验?</span> </a> <div class="entry-page-info"> <span class="pull-right">下一篇 »</span> <span class="pull-left">2024-12-11</span> </div> </div> </div> <!--下一篇上一篇--> <!--相关文章s--> <div class="part-mor"> <h3 class="section-title"> <span> 相关文章 </span> </h3> <div class="section-cont"> <div class="items"> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/17317.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/3a4f6d7d853565905d3fe9cec58ca745-210-160-1.png)"><i class="mask"></i></i></div> <h2>如何在服务器上有效运行JavaScript代码?</h2> </a> </div> </div> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/17114.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/981685e5f40864d0f919d2ecf42d0413-210-160-1.png)"><i class="mask"></i></i></div> <h2>如何实现App中图片滚动效果?探索JS解决方案!</h2> </a> </div> </div> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/17097.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/fe49eff713260a89d1f14072be680fa1-210-160-1.png)"><i class="mask"></i></i></div> <h2>如何正确处理服务器返回的JSON数组数据?</h2> </a> </div> </div> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/17073.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/5befd7b04734321c25dce78f28d1b6f9-210-160-1.jpg)"><i class="mask"></i></i></div> <h2>如何实现服务器返回HTML代码?</h2> </a> </div> </div> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/16753.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/b4d7ea4457f75b7cf61e4a2ef228afbe-210-160-1.png)"><i class="mask"></i></i></div> <h2>如何实现APP嵌入网页并注入JavaScript代码?</h2> </a> </div> </div> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/16604.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/e6d22cd2f9e2fd634f47bbb34361687e-210-160-1.png)"><i class="mask"></i></i></div> <h2>如何获取并使用App展示网站的源码?</h2> </a> </div> </div> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/16075.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/035dc33dffa18fef7da980755f553166-210-160-1.png)"><i class="mask"></i></i></div> <h2>如何在app.js中有效设置全局变量?</h2> </a> </div> </div> <div class="item"> <div class="hunter-item"> <a href="https://kun123.com/article/16045.html"> <div class="hunter-thumb"><i class="thumb " style="background-image:url(https://kun123.com/zb_users/cache/thumbs/1bc9ce24fbd856316c63d80b4c69d45e-210-160-1.png)"><i class="mask"></i></i></div> <h2>如何利用app.js实现模态框功能?</h2> </a> </div> </div> </div> </div> </div> <!--相关文章e--> <div class="hide_body"></div> <div class="show_body"> <a class="show_body_c" href="javascript:void(0)" onclick="yk_reward()" title="关闭"><img src="https://kun123.com/zb_users/theme/yk_lltx/static/image/close.png" alt="取消" /></a> <div class="reward_img"> </div> <div class="reward_bg"> <div class="pay_box choice" data-id=""> <span class="qr_code"><img src="https://kun123.com/zb_users/theme/yk_lltx/static/image/wechat.svg" alt="微信二维码"/></span> </div> <div class="pay_box" data-id=""> <span class="qr_code"><img src="https://kun123.com/zb_users/theme/yk_lltx/static/image/alipay.svg" alt="支付宝二维码"/></span> </div> </div> </div> <h3 class="main__title">发表评论</h3> <div id="comments" class="commpost"> <div class="comment-post-body"></div> <div id="divCommentPost" class="respond"> <div class="cancel-comment-reply"> <a id="cancel-reply" href="#divCommentPost" rel="nofollow" style="display:none;color: #EE1122">取消回复</a> </div> <form id="new_comment_form" method="post" action="https://kun123.com/zb_system/cmd.php?act=cmt&postid=17022&key=1bba495636ec25ad55ba6640a1b22dc8"> <input type="hidden" name="inpId" id="inpId" value="17022"/> <input type="hidden" name="inpRevID" id="inpRevID" value="0"/> <div class="comment_triggered" style="display: block;"> <div class="input_body qqget_all"> <ul class="ident qqget_input"> <li class="qq_li"> <input type="text" class="form-control " name="inpName" id="inpName" placeholder="昵称*" > </li> <li class="qq_li qqget_mail"> <input type="text" class="form-control" name="inpEmail" id="inpEmail" placeholder="邮件" value=""> </li> <li class="qq_li"> <input type="text" class="form-control " name="inpHomePage" id="inpHomePage" placeholder="个人首页" value=""> </li> </ul> </div> </div> <div class="re_face"> <div id="showfacenamereplace" class="re_img"></div> </div> <div class="new_comment"> <textarea name="txaArticle" id="txaArticle" rows="4" class="textarea_box" style="height: auto;" placeholder="呐,做人呢,最重要的是开心,你饿不饿,我煮碗面给你吃啊。----《大内密探零零发》"></textarea> </div> <div class="comment_triggered" style="display: block;"> <div class="input_body qqget_all"> <input type="button" value="提交评论" class="comment_submit_button c_button qq_btn" onclick="return zbp.comment.post()"> </div> </div> </form> </div> <h4 class="comments-title"> <span style="color:#E1171B">暂无评论,1人围观</span> </h4> <label id="AjaxCommentBegin"></label> <div class="comment-list"> </div> <label id="AjaxCommentEnd"></label> </div> <link rel="stylesheet" href="https://kun123.com/zb_users/theme/yk_lltx/static/css/OwO.min.css" media="all"> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/OwO.js"></script> <script> function Share(pType){ var pTitle = "服务器为何返回HTML代码?"; //待分享的标题 var pImage = "https://kun123.com/zb_users/cache/thumbs/29fd722e8fdab06ccfbc0cc2192b578f-210-160-1.png"; //待分享的图片 var pContent = "HTML基础介绍HTML(HyperText Markup Language)是一种用于创建网页的标准标记语言,它描述了网页的结构和内容,是构建网页的基础,..."; //待分享的内容 var pUrl = window.location.href; //当前的url地址 var pObj = jQuery("div[class='yogo_hc']").find("h4"); if(pObj.length){ pTitle = pObj.text();} var pObj = jQuery("div[class='yogo_hcs']").find("em"); if(pObj.length){ pContent = pObj.text(); } var pObj = jQuery("div[class='con_cons']").find("img"); if(pObj.length){ pImage = jQuery("div[class='con_cons']").find("img",0).attr("src");} shareys(pType, pUrl, pTitle,pImage, pContent); } </script> <!--<script>--> <!-- $(".entry-content img").each(function(){--> <!-- var imgsec=$(this).attr("src");--> <!-- var index= imgsec.lastIndexOf(".");--> <!-- var ext = imgsec.substr(index+1);--> <!-- if(isAssetTypeAnImage(ext)){--> <!-- if($(this).hasClass("ctn_img")){--> <!-- $(this).attr({"data-url":imgsec+"?imageView2/0/format/jpg/q/75","src":"https://kun123.com/zb_users/theme/yk_lltx/static/image/piex.gif"});--> <!-- $(this).addClass("scrollLoading");--> <!-- }}--> <!-- });--> <!--</script>--> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/html2canvas.min.js"></script> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/common.js"></script> <script> var poster_open = 'on'; var txt1 = '长按识别二维码查看'; var txt2 = '酷北运营网'; var comiis_poster_start_wlat = 0; var comiis_rlmenu = 1; var comiis_nvscroll = 0; var comiis_poster_time_baxt; $(document).ready(function(){ $(document).on('click', '.comiis_poster_a', function(e) { show_comiis_poster_ykzn(); }); }); function comiis_poster_rrwz(){ setTimeout(function(){ html2canvas(document.querySelector(".comiis_poster_box_img"), {scale:2,useCORS:true}).then(canvas => { var img = canvas.toDataURL("image/jpeg", .9); document.getElementById('comiis_poster_images').src = img; $('.comiis_poster_load').hide(); $('.comiis_poster_imgshow').show(); }); }, 100); } function show_comiis_poster_ykzn(){ if(comiis_poster_start_wlat == 0){ comiis_poster_start_wlat = 1; popup.open('<img src="https://kun123.com/zb_users/theme/yk_lltx/plugin/img/imageloading.gif" class="comiis_loading" alt="图片">'); var url = window.location.href.split('#')[0]; url = encodeURIComponent(url); var html = '<div id="comiis_poster_box" class="comiis_poster_nchxd">\n' + '<div class="comiis_poster_box">\n' + '<div class="comiis_poster_okimg">\n' + '<div style="padding:150px 0;" class="comiis_poster_load">\n' + '<div class="loading_color">\n' + ' <span class="loading_color1"></span>\n' + ' <span class="loading_color2"></span>\n' + ' <span class="loading_color3"></span>\n' + ' <span class="loading_color4"></span>\n' + ' <span class="loading_color5"></span>\n' + ' <span class="loading_color6"></span>\n' + ' <span class="loading_color7"></span>\n' + '</div>\n' + '<div class="comiis_poster_oktit">正在生成海报, 请稍候</div>\n' + '</div>\n' + '<div class="comiis_poster_imgshow" style="display:none">\n' + '<img src="" class="vm" id="comiis_poster_images">\n' + '<div class="comiis_poster_oktit">↑长按上图保存图片分享</div>\n' + '</div>\n' + '</div>\n' + '<div class="comiis_poster_okclose"><a href="javascript:;" class="comiis_poster_closekey"><img src="https://kun123.com/zb_users/theme/yk_lltx/plugin/img/poster_okclose.png" class="vm"></a></div>\n' + '</div>\n' + '<div class="comiis_poster_box_img">\n' + '<div class="comiis_poster_img"><div class="img_time">11<span>2024/12</span></div><img src="https://kun123.com/zb_users/cache/thumbs/29fd722e8fdab06ccfbc0cc2192b578f-210-160-1.png" class="vm" id="comiis_poster_image"></div>\n' + '<div class="comiis_poster_tita">服务器为何返回HTML代码?</div>\n' + '<div class="comiis_poster_txta">HTML基础介绍HTML(HyperText Markup Language)是一种用于创...</div><div class="comiis_poster_x guig"></div >\n' + '<div class="comiis_poster_foot">\n' + '<img src="https://kun123.com/zb_users/theme/yk_lltx/plugin/api.php?url=' + url + '" class="kmewm fqpl vm">\n' + '<img src="https://kun123.com/zb_users/theme/yk_lltx/plugin/img/poster_zw.png" class="kmzw vm"><span class="kmzwtip">' + txt1 + '<br>' + txt2 + '</span>\n' + '</div>\n' + '</div>\n' + '</div>'; if(html.indexOf("comiis_poster") >= 0){ comiis_poster_time_baxt = setTimeout(function(){ comiis_poster_rrwz(); }, 5000); $('body').append(html); $('#comiis_poster_image').on('load',function(){ clearTimeout(comiis_poster_time_baxt); comiis_poster_rrwz(); }); popup.close(); setTimeout(function() { $('.comiis_poster_box').addClass("comiis_poster_box_show"); $('.comiis_poster_closekey').off().on('click', function(e) { $('.comiis_poster_box').removeClass("comiis_poster_box_show").on('webkitTransitionEnd transitionend', function() { $('#comiis_poster_box').remove(); comiis_poster_start_wlat = 0; }); return false; }); }, 60); } } } var new_comiis_user_share, is_comiis_user_share = 0; var as = navigator.appVersion.toLowerCase(), isqws = 0; if (as.match(/MicroMessenger/i) == "micromessenger" || as.match(/qq\//i) == "qq/") { isqws = 1; } if(isqws == 1){ if(typeof comiis_user_share === 'function'){ new_comiis_user_share = comiis_user_share; is_comiis_user_share = 1; } var comiis_user_share = function(){ if(is_comiis_user_share == 1){ isusershare = 0; new_comiis_user_share(); if(isusershare == 1){ return false; } } isusershare = 1; show_comiis_poster_ykzn(); return false; } } </script> </div> <div class="col-md-3 widget-area post_sider" id="secondary"> <div class="widget-fixed"></div> </div> </div> </main> </div> <footer> <div class="chenyuyc" style="margin-top: 20px;"> <div class="footer-fav"> <div class="container"> <div class="fl site-info" style="width: 60%;padding-right: 24px"> <h2>酷北运营网</h2> <div class="site-p"> <p><p><i class="ri-medal-line ri-lg"></i> 本站内容均来自网络,仅供参考学习交流,如有侵权,请联系m4g6@qq.com处理解决。 <br>© CopyRight 2024-2024 <a href="https://kun123.com/" title="酷北运营网" target="_blank">酷北运营网</a></p></p> <p>页面执行:<!--327.33 ms , 14 queries , 7101kb memory , 0 error-->327.33 ms</p> </div> </div> <div class="fr site-fav" style="width:10%"> </div> <div class="fr site-fav" style="width:30%;padding: 24px"> <h4>想要提升自媒体影响力和增加收入吗?我们分享最有效的各种运营技巧,帮助你快速提高影响力,实现可观的收入增长。</h4> </div> </div> </div> </div> <div class="yk_beian"> <img src="https://kun123.com/zb_users/theme/yk_lltx/static/image/icp.png" alt="icp" width="13"><a href="https://beian.miit.gov.cn/#/Integrated/index" rel="nofollow" target="_blank" style="color: #73777a;margin-right: 20px;">渝ICP备2023007097号-3</a> </div> <meta name="baidu-site-verification" content="codeva-Oayhu2ySFz" /> </footer> <div class="progress-wrap"> <svg class="progress-circle svg-content" width="100%" height="100%" viewbox="-1 -1 102 102"> <path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98"></path> </svg> </div> <div class="listree-box"> <h3 class="listree-titles"><a class="listree-btn" title="展开">目录[+]</a></h3> <ul id="listree-ol" style="display:none;"></ul> </div> <script> function autotree() { $(document) .ready(function() { var c = 1, b = $("#listree-ol"); $("#listree-bodys") .find("h1, h2, h3,h4,h5,h6") .each(function(a) { if ("" !== $(this) .text() .trim()) { $(this) .attr("id", "listree-list" + a) .attr("class", "listree-list"); var d = parseInt($(this)[0].tagName.slice(1)); 0 === a || d === c ? (a = $('<li><a id="listree-click" href="#listree-list' + a + '">' + $(this) .text() + "</a></li>"), b.append(a)) : d > c ? (a = $('<ul><li><a id="listree-click" href="#listree-list' + a + '">' + $(this) .text() + "</a></li></ul>"), b.append(a), b = a) : d < c && (a = $('<li><a id="listree-click" href="#listree-list' + a + '">' + $(this) .text() + "</a></li>"), 1 === d ? ($("#listree-ol") .append(a), b = $("#listree-ol")) : (b.parent("ol") .append(a), b = b.parent("ol"))); c = d } }); $(".listree-btn") .click(function() { "\u76ee\u5f55[+]" == $(".listree-btn") .text() ? $(".listree-btn") .attr("title", "\u6536\u8d77") .text("\u76ee\u5f55[-]") .parent() .next() .show(500) : $(".listree-btn") .attr("title", "\u5c55\u5f00") .text("\u76ee\u5f55[+]") .parent() .next() .hide(500); return !1 }); $("a#listree-click") .click(function(a) { a.preventDefault(); $("html, body") .animate({ scrollTop: $($(this) .attr("href")) .offset() .top - 65 }, 800) }); 1 < c && $(".listree-box").css("display", "block") }) } autotree(); jQuery(document).ready(function($) { var p = $('.listree-list'); if (p.length < 1) return; var arr = []; function part_offset_top() { p.each(function() { var of = $(this) .offset(); arr.push(Math.floor( of .top)) }) } function goto_current(index) { var a = $('#listree-ol li'); var b = $('.listree-list dt'); if (a.length < 1) return; var h = a.outerHeight(); if (!a.eq(index) .hasClass('current')) { a.removeClass('current'); a.eq(index) .addClass('current'); b.animate({ 'top': h * index + (a.outerHeight() - b.outerHeight()) / 2 + 1 }, 50) } } function window_scroll() { var st = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; var limit = Math.ceil(st + 65); var index = 0; for (var i = 0; i < arr.length; i++) { if (limit >= arr[i]) { index = i } else { break } } if (index < 0) index = 0; if (!p.eq(index) .hasClass('current')) { p.removeClass('current'); p.eq(index) .addClass('current'); goto_current(index) } } part_offset_top(); setTimeout(window_scroll, 0); $(window).on('scroll', window_scroll) }); </script></div> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/jquery.pjax.js"></script> <script> //底部移动端菜单pjax $(document).pjax('a[data-pjax]', { container: '#main', fragment: '#main', timeout: 8000, scrollTo: true }).on('pjax:send', function() { NProgress.start(); }).on('pjax:complete', function() { NProgress.done(); var swiper = new Swiper(".swiper-container", { pagination: ".swiper-pagination", direction: "vertical", slidesPerView: 1, paginationClickable: !0, spaceBetween: 30, mousewheelControl: !0 }); // poidget(); $(".right").css({'display': 'none'}) }) </script> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/swiper.min.js"></script> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/getcon.js"></script> <div class="mobile-overlay"></div> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/script.js"></script> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/viewhistory.js"></script> <script src="https://kun123.com/zb_users/theme/yk_lltx/static/js/main.js"></script> <script>hljs.initHighlightingOnLoad();</script> <script>$(function() {$(".scrollLoading").scrollLoading();});</script> <script> jl_viewHistory({ limit: 5, storageKey: 'jl_viewHistory', primaryKey: 'url', addHistory: false, titleSplit: '|' }); </script> <script> console.log('%c 正版授权:YK琳琅天下 https://ykbkw.top %c 😊 Theme By 勇康博客网 ', 'font-family:\'Microsoft YaHei\',\'SF Pro Display\',Roboto,Noto,Arial,\'PingFang SC\',sans-serif;color:white;background:#ffa099;padding:5px 0;', 'font-family:\'Microsoft YaHei\',\'SF Pro Display\',Roboto,Noto,Arial,\'PingFang SC\',sans-serif;color:#ffa099;background:#404040;padding:5px 0;'); // 你能留下我的信息, 我会很高兴的 ^_^ </script> </body> </html><!--327.55 ms , 14 queries , 7101kb memory , 0 error-->