千锋教育-做有情怀、有良心、有品质的职业教育机构

手机站
千锋教育

千锋学习站 | 随时随地免费学

千锋教育

扫一扫进入千锋手机站

领取全套视频
千锋教育

关注千锋学习站小程序
随时随地免费学习课程

当前位置:首页  >  技术干货  > xml格式简介

xml格式简介

来源:千锋教育
发布人:xqq
时间: 2023-07-28 14:46:45 1690526805

XML(可扩展标记语言)是一种用于描述数据的标记语言,它被广泛应用于数据交换和存储。XML的设计目标是传输和存储数据,同时具备可读性和可扩展性。

XML采用了类似HTML的标记语法,但与HTML不同的是,XML并不预定义任何标签。这意味着XML可以根据具体的应用需求定义自己的标签,使其更加灵活和适应各种数据结构。

XML的基本语法规则包括以下几个方面:

1. 标签:XML使用尖括号(< >)来定义标签,标签可以包含属性和值。例如,是一个标签,可以用来表示一本书。

2. 元素:XML中的标签被称为元素,一个元素可以包含其他元素或文本内容。例如,元素可以包含、<author>和<price>等子元素。 <p style="text-indent: 2em;">3. 属性:XML的标签可以包含属性,属性用于提供关于元素的额外信息。属性由名称和值组成,使用等号(=)进行赋值。例如,<book id="001">表示该书的ID属性为"001"。</p> <p style="text-indent: 2em;">4. 嵌套:XML允许元素嵌套,即一个元素可以包含其他元素。这种嵌套结构可以用来表示复杂的数据关系。</p> <p style="text-indent: 2em;">5. 实体引用:XML使用实体引用来表示一些特殊字符,例如小于号(<)、大于号(>)和引号(")。这样可以避免这些字符与标签语法冲突。</p> <p style="text-indent: 2em;">XML的优点包括:</p> <p style="text-indent: 2em;">1. 可读性强:XML使用标签和嵌套结构来描述数据,使得数据具有良好的可读性,便于人们理解和编辑。</p> <p style="text-indent: 2em;">2. 可扩展性好:XML的标签可以根据需要自定义,可以适应各种数据结构和应用需求。</p> <p style="text-indent: 2em;">3. 跨平台和跨语言:XML是一种通用的数据格式,可以在不同的平台和编程语言之间进行数据交换和共享。</p> <p style="text-indent: 2em;">4. 支持数据验证:XML可以使用DTD(文档类型定义)或XML Schema来定义数据的结构和规则,从而实现数据的验证和合法性检查。</p> <p style="text-indent: 2em;">总结一下,XML是一种用于描述数据的标记语言,具有可读性强、可扩展性好、跨平台和跨语言等优点。它被广泛应用于数据交换和存储,为各种应用提供了一种通用的数据格式。</p> </div> <div class="tag-wrap" style="margin: 30px auto 0;width: 810px;display: -ms-flexbox;display: flex;-ms-flex-align: center;align-items: center;"> <span class="tag-label" style="font-size: 16px; line-height: 22px;margin-right: 6px;">tags:</span> <a id="tag_click" target="_blank" style="display: inline-block" href="http://www.mobiletrain.org/tag-0-1.html">xml格式简介</a> </div> <div class="con-left-bottom"> 声明:本站稿件版权均属千锋教育所有,未经许可不得擅自转载。 </div> <div class="left-form"> <div class="left-form-left"> <div class="h3">10年以上业内强师集结,手把手带你蜕变精英</div> <div class="list-form-item"> <i class="ypfont yp-name"></i> <input type="text" placeholder="您的姓名" name="realname" id="realname" autocomplete="off" /> </div> <div class="list-form-item list-form-item2"> <i class="ypfont yp-shouji"></i> <input type="text" placeholder="您的电话" name="realphone" id="phone" autocomplete="off" /> </div> <div class="h4">请您保持通讯畅通,专属学习老师24小时内将与您1V1沟通</div> <div class="list-submit"> 免费领取<br /><i class="ypfont yp-dianjitianjia"></i> </div> </div> <div class="left-form-right"> <div class="h3">今日已有<span>369</span>人领取成功</div> <div class="swiper-container swiper-phone swiper-no-swiping"> <div class="swiper-wrapper"> <div class="swiper-slide"> 刘同学 138****2860 刚刚成功领取 </div> <div class="swiper-slide"> 王同学 131****2015 刚刚成功领取 </div> <div class="swiper-slide"> 张同学 133****4652 刚刚成功领取 </div> <div class="swiper-slide"> 李同学 135****8607 刚刚成功领取 </div> <div class="swiper-slide"> 杨同学 132****5667 刚刚成功领取 </div> <div class="swiper-slide"> 岳同学 134****6652 刚刚成功领取 </div> <div class="swiper-slide"> 梁同学 157****2950 刚刚成功领取 </div> <div class="swiper-slide"> 刘同学 189****1015 刚刚成功领取 </div> <div class="swiper-slide"> 张同学 155****4678 刚刚成功领取 </div> <div class="swiper-slide"> 邹同学 139****2907 刚刚成功领取 </div> <div class="swiper-slide"> 董同学 138****2867 刚刚成功领取 </div> <div class="swiper-slide"> 周同学 136****3602 刚刚成功领取 </div> </div> </div> </div> </div> </div> <div class="c_page_bottom"> <div class="c_page_bottom_item"> <div class="c_page_bottom_item_up"></div> <p>上一篇</p> <a href="http://www.mobiletrain.org/about/BBS/135375.html" title="135376" target="_blank">java的关键字有哪些</a> </div> <div class="c_page_bottom_item"> <div class="c_page_bottom_item_next"></div> <p>下一篇</p> <a href="http://www.mobiletrain.org/about/BBS/135377.html" target="_blank" title="135376">switch语句语法及原理</a> </div> </div> <div class="left-ad"> <a href="javascript:;" onclick="open53_pc()" rel="nofollow" class="left-ad-btn"> 免费打包获取<i class="ypfont yp-dianjitianjia"></i> </a> </div> <!-- <div class="article"> <div class="article-left"> <h3 class="art-tit">猜你喜欢<span>LIKE</span></h3> <div class="art-con"> <a href="http://www.mobiletrain.org/zcjy/linux/136992.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/2023/0428/1682660765277.png" alt="" /> </div> <div class="art-item-info"> <h4>云计算技术就业前景以及发展方向怎样?</h4> <span> <i class="ypfont yp-shijian"></i> 2023-08-07 </span> </div> </a> <a href="http://www.mobiletrain.org/zcjy/html5/136991.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/2023/0428/1682660577662.png" alt="" /> </div> <div class="art-item-info"> <h4>HTML5开发就业前景以及发展方向怎样?</h4> <span> <i class="ypfont yp-shijian"></i> 2023-08-07 </span> </div> </a> <a href="http://www.mobiletrain.org/zcjy/bigdata/136903.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/2023/0428/1682660971839.png" alt="" /> </div> <div class="art-item-info"> <h4>大数据数据分析目前就业前景如何?</h4> <span> <i class="ypfont yp-shijian"></i> 2023-08-07 </span> </div> </a> </div> </div> <div class="article-right"> <h3 class="art-tit">最新文章<span>NEW</span></h3> <div class="art-con"> <a href="http://www.mobiletrain.org/about/BBS/211051.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/ty35.jpg" alt="" /> </div> <div class="art-item-info"> <h4>如何在ThinkPHP6中使用日志?</h4> <span> <i class="ypfont yp-shijian"></i> 2023-10-16 </span> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/211047.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/ty47.jpg" alt="" /> </div> <div class="art-item-info"> <h4>如何在麒麟操作系统上进行软件更新和升级?</h4> <span> <i class="ypfont yp-shijian"></i> 2023-10-16 </span> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/211026.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/ty53.jpg" alt="" /> </div> <div class="art-item-info"> <h4>你拨打的用户正忙是什么意思?</h4> <span> <i class="ypfont yp-shijian"></i> 2023-10-16 </span> </div> </a> </div> </div> </div> --> <div class="article article-hot" style="margin-top: 20px"> <div class="article-tit-box"> <div class="art-tit h3"> 相关推荐<span class="art-hot">HOT</span> </div> <!-- <a href="javascript:;" onclick="open53_pc()">更多>></a> --> </div> <div class="art-con"> <a href="http://www.mobiletrain.org/about/BBS/211040.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/ty36.jpg" alt="" /> </div> <div class="art-item-info"> <div class="h4">如何使用ThinkPHP6实现Excel导入导出?</div> <p> 一、环境和所需工具包的准备在开始实际的操作之前,确保您已经安装了ThinkPHP6框架并运行正常。接着,我们需要一个PHP工具库来方便处理Excel文...<span>详情>></span> </p> <span>2023-10-16 10:29:28</span> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/211002.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/tongyong1.jpg" alt="" /> </div> <div class="art-item-info"> <div class="h4">Java 8用哪个版本Java EE? 不同版本Java EE有什么区别??</div> <p> 1、发布时间与Java SE的对应版本Java EE 6:2009年发布,匹配Java SE 6。Java EE 7:2013年发布,匹配Java SE 7和Java SE 8。Java EE 8:2<span>详情>></span> </p> <span>2023-10-16 10:05:20</span> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/210998.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/ty55.jpg" alt="" /> </div> <div class="art-item-info"> <div class="h4">java里的doget()和dopost()用法有什么区别?</div> <p> 1、请求方式不同 doGet()对应HTTP的GET请求,它通常用于获取信息。此种请求的数据被附加到URL后面,它们之间用?分隔。而doPost()对应HTTP的POST...<span>详情>></span> </p> <span>2023-10-16 10:02:28</span> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/210953.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/ty60.jpg" alt="" /> </div> <div class="art-item-info"> <div class="h4">流量分为哪几种类型?</div> <p> 一、有机流量有机流量是通过搜索引擎如Google、百度等获得的流量,通常不需要付费。这种流量通常具有高转化率和用户参与度,因为用户是通过搜索...<span>详情>></span> </p> <span>2023-10-16 09:24:36</span> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/210940.html" target="_blank" class="art-item"> <div class="art-item-img"> <img src="/tywzt/ty32.jpg" alt="" /> </div> <div class="art-item-info"> <div class="h4">脚本语言有哪几种?</div> <p> 一、PYTHONPython是一种广泛使用的高级编程语言,具有代码可读性强、简洁高效的特点。该语言广泛应用于数据分析、机器学习、网络开发和自动化等...<span>详情>></span> </p> <span>2023-10-16 09:15:24</span> </div> </a> </div> </div> </div> </div> <div class="con-right"> <div class="con-right-rywd"> <div class="rywd-tit h3"> <i class="ypfont yp-weinituijian"></i>热门推荐 </div> <div class="swiper3"> <a href="http://www.mobiletrain.org/about/BBS/211056.html" target="_blank"> <div class="ypfont yp-zhiding"></div> <p>gitlab怎么创建新分支并提交代码?</p> <span class="a11">沸</span> </a> <a href="http://www.mobiletrain.org/about/BBS/211051.html" target="_blank"> <div class="ypfont yp-1"></div> <p>如何在ThinkPHP6中使用日志?</p> <span class="a21">热</span> </a> <a href="http://www.mobiletrain.org/about/BBS/211047.html" target="_blank"> <div class="ypfont yp-2"></div> <p>如何在麒麟操作系统上进行软件更新和升级?</p> <span class="a31">热</span> </a> <a href="http://www.mobiletrain.org/about/BBS/211042.html" target="_blank"> <div class="ypfont yp-3"></div> <p>如何解决Linux系统中出现的进程占用过多内存问题?</p> <span class="a41">新</span> </a> <a href="http://www.mobiletrain.org/about/BBS/211040.html" target="_blank"> <div class="a5"> 4 </div> <p>如何使用ThinkPHP6实现Excel导入导出?</p> </a> <a href="http://www.mobiletrain.org/about/BBS/211034.html" target="_blank"> <div class="a6"> 5 </div> <p>怎么配置Python环境?</p> </a> <a href="http://www.mobiletrain.org/about/BBS/211031.html" target="_blank"> <div class="a7"> 6 </div> <p>为什么视频保存后相册找不到?</p> </a> <a href="http://www.mobiletrain.org/about/BBS/211026.html" target="_blank"> <div class="a8"> 7 </div> <p>你拨打的用户正忙是什么意思?</p> </a> <a href="http://www.mobiletrain.org/about/BBS/211024.html" target="_blank"> <div class="a9"> 8 </div> <p>linux cpu sys是什么占用过高?</p> </a> <a href="http://www.mobiletrain.org/about/BBS/211021.html" target="_blank"> <div class="a10"> 9 </div> <p>Java的list.forEach方法和foreach效率有区别吗?</p> </a> </div> <!-- <div class="swiper-button-prev swiper-button-prev3"> <i class="indexfont index-youjiantou-copy"></i> </div> <div class="swiper-button-next swiper-button-next3"> <i class="ypfont yp-huanyipi"></i>换一批 </div> --> </div> <!-- 面试题库 --> <a href="javascript:;" rel="nofollow" onclick="open53_pc()" class="right-ad"> <img src="/images/right-ad.jpg" alt="" /></a> <!-- 技术干货 --> <div class="con-right-rywd"> <div class="tk-tit h3"> <a class="left" href="http://www.mobiletrain.org/about/BBS/" target="_blank"><i class="ypfont yp-fabujishu" ></i>技术干货</a> <a href="http://www.mobiletrain.org/about/BBS/" target="_blank">更多>></a> </div> <div class="swiper2 "> <a href="http://www.mobiletrain.org/about/BBS/258998.html" class="swiper-slide" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/ty33.jpg" alt="" /> </div> <div> <div class="h3">如何实现服务器负载均衡</div> <p>2023-12-06</p> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/258997.html" class="swiper-slide" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/tongyong12.jpg" alt="" /> </div> <div> <div class="h3">linux有哪些优势和劣势</div> <p>2023-12-06</p> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/258996.html" class="swiper-slide" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/ty64.jpg" alt="" /> </div> <div> <div class="h3">linux需要驱动吗</div> <p>2023-12-06</p> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/258995.html" class="swiper-slide" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/tongyong7.jpg" alt="" /> </div> <div> <div class="h3">android与linux的区别</div> <p>2023-12-06</p> </div> </a> <a href="http://www.mobiletrain.org/about/BBS/258994.html" class="swiper-slide" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/ty64.jpg" alt="" /> </div> <div> <div class="h3">如何搭建基于容器的深度学习环境</div> <p>2023-12-06</p> </div> </a> </div> </div> <!-- 职场就业 --> <div class="con-right-rywd"> <div class="tk-tit h3"> <a class="left" href="http://www.mobiletrain.org/zcjy/" target="_blank"><i class="ypfont yp-minzhengtubiao1-46" ></i>职场就业</a> <a href="http://www.mobiletrain.org/zcjy/" target="_blank">更多>></a> </div> <div class="swiper2 "> <a href="http://www.mobiletrain.org/zcjy/wlaq/259025.html" class="swiper-slide zcjy" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/ty41.jpg" alt="" /> </div> <div> <div class="h3">网络安全软件开发的就业前景</div> <p>2023-12-09</p> </div> </a> <a href="http://www.mobiletrain.org/zcjy/python/259024.html" class="swiper-slide zcjy" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/tongyong6.jpg" alt="" /> </div> <div> <div class="h3">学会python工程师后的就业前景</div> <p>2023-12-09</p> </div> </a> <a href="http://www.mobiletrain.org/zcjy/java/259023.html" class="swiper-slide zcjy" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//tywzt/tongyong2.jpg" alt="" /> </div> <div> <div class="h3">学会java工程师后的就业前景</div> <p>2023-12-09</p> </div> </a> <a href="http://www.mobiletrain.org/zcjy/linux/136992.html" class="swiper-slide zcjy" target="_blank"> <div class="img-box"> <img src="http://www.mobiletrain.org//2023/0428/1682660765277.png" alt="" /> </div> <div> <div class="h3">云计算技术就业前景以及发展方向怎样?</div> <p>2023-08-07</p> </div> </a> </div> </div> <!-- 快速通道 --> <div class="con-right-rywd"> <div class="rywd-tit h3"> <i class="ypfont yp-weinituijian"></i>快速通道</div> <ul class="kstd"> <li> <div class="h3">培训机构</div> <a href="http://www.mobiletrain.org/training/" target="_blank">了解培训相关</a> </li> <li> <div class="h3">就业前景</div> <a href="http://www.mobiletrain.org/zcjy/" target="_blank">查看就业前景</a> </li> <li> <div class="h3">培训门槛</div> <a href="http://www.mobiletrain.org/ljc/" target="_blank">了解学习门槛</a> </li> <li> <div class="h3">应聘面试</div> <a href="http://www.mobiletrain.org/interview/" target="_blank">常见面试考题</a> </li> <li> <div class="h3">就业服务</div> <a href="http://www.mobiletrain.org/employ/" target="_blank" rel="nofollow">毕业推荐就业</a> </li> <li> <div class="h3">师资团队</div> <a href="http://www.mobiletrain.org/teachers/" target="_blank" rel="nofollow">了解师资团队</a> </li> </ul> </div> </div> </div> </div> </div> </div> <link rel="stylesheet" href="/css/css3451.css"> <div class="edu-footer"> <div class="base"> <div class="con-left"> <img src="http://www.mobiletrain.org/images_index/new-logo-white.png" class="edu-footer-logo" /> <p class="edu-footer-sologan">初心至善  匠心育人</p> <p class="edu-footer-phoneNumber"> <i class="icon icon-dianhua1"></i>400-811-9990 <a href="javascript:;" onclick="open53_pc()" rel="nofollow">24小时在线咨询</a> </p> </div> <div class="con-right"> <div class="edu-footer-about-links"> <div class="list1 list"> <div class="h4">关于千锋</div> <ul> <li> <a href="http://www.mobiletrain.org/about/" target="_blank" rel="nofollow">千锋简介</a> </li> <li> <a href="http://www.mobiletrain.org/about/contact.html" target="_blank" rel="nofollow">联系我们</a> </li> <li> <a href="http://www.mobiletrain.org/qynx/" target="_blank" rel="nofollow">企业服务</a> </li> <li> <a href="http://www.mobiletrain.org/topic/fygy.html" target="_blank" rel="nofollow">锋益公益</a> </li> </ul> </div> <div class="list1 list"> <div class="h4">学习资源</div> <ul> <li> <a href="http://prj.qfedu.com/" target="_blank" rel="nofollow">项目库</a> </li> <li> <a href="http://www.mobiletrain.org/open/" target="_blank" rel="nofollow">公开课</a> </li> <li> <a href="http://video.mobiletrain.org/" target="_blank" rel="nofollow">视频教程</a> </li> <!-- <li> <a href="http://www.mobiletrain.org/book/index.html?type=1" target="_blank" rel="nofollow">原创丛书</a> </li> --> </ul> </div> <div class="list1 list"> <div class="h4">服务指南</div> <ul> <li> <a href="javascript:;" onclick="open53_pc()" rel="nofollow">报名咨询</a> </li> <li> <a href="javascript:;" onclick="open53_pc()" rel="nofollow">校区分布</a> </li> <li> <a href="http://www.mobiletrain.org/sitemap.html" target="_blank" rel="nofollow">网站地图</a> </li> <li> <a href="http://www.mobiletrain.org/privacyPolicy.html" target="_blank" rel="nofollow">隐私声明</a> </li> </ul> </div> </div> <div class="qrcode-box"> <div class="qrcode flex-center"> <img src="/wzt/qr-code-new.png" alt="千锋教育" /> </div> <div class="h4">千锋学习站 | <span>随时随地免费学</span></div> </div> <div class="qrcode-box"> <div class="qrcode flex-center"> <img src="http://www.mobiletrain.org/images_index/qr-code-new2.png" alt="千锋教育" /> </div> <div class="h4">扫一扫进入千锋手机站</div> </div> </div> </div> </div> <div class="footer-link"> <div class="base"> <div class="links-tab"> <span class="active">热门课程</span> <!-- <span>热点话题</span> --> <!-- <span>学习线路图</span> --> <!-- <span>千锋全国</span> --> </div> <div class="links-a active"> <!-- 编辑配置cms --> <a href="http://www.mobiletrain.org/" target="_blank">IT培训</a> <a href="http://java.mobiletrain.org/" target="_blank">java培训</a> <a href="http://www.mobiletrain.org/special/harmonyos.html" target="_blank">鸿蒙开发培训</a> <a href="http://www.mobiletrain.org/special/emb.html" target="_blank">嵌入式培训</a> <a href="http://www.mobiletrain.org/special/python.html" target="_blank">python培训</a> <a href="http://www.mobiletrain.org/special/ui.html" target="_blank">UI培训</a> <a href="http://www.mobiletrain.org/special/test.html" target="_blank">软件测试培训</a> <a href="http://www.mobiletrain.org/special/linux.html" target="_blank">云计算培训</a> <a href="http://www.mobiletrain.org/special/bigdata.html" target="_blank">大数据培训</a> <a href="http://www.mobiletrain.org/special/wlw.html" target="_blank">物联网培训</a> <a href="http://www.mobiletrain.org/special/wlw.html" target="_blank">游戏开发培训</a> <a href="http://www.mobiletrain.org/special/qmt.html" target="_blank">全媒体运营培训</a> <a href="http://www.mobiletrain.org/special/ysjj.html" target="_blank">影视剪辑培训</a> <a href="http://www.mobiletrain.org/special/wlaq.html" target="_blank">网络安全培训</a> </div> <!-- <div class="links-a"> --> <!-- 编辑配置cms3490 --> <!-- </div> --> <!-- <div class="links-a"> 编辑配置cms 3442 </div> --> <!-- <div class="links-a"> --> <!-- 编辑配置cms3443 --> <!-- </div> --> </div> <div class="copyright"> <p class="copyright-p"> Copyright 2011-2024 <a href="javascript:;" rel="nofollow" title="千锋互联">北京千锋互联科技有限公司</a> <a href="https://beian.miit.gov.cn/" rel="nofollow"> 京ICP备12003911号-3 </a> <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802035719" rel="nofollow" style="display: inline-block;text-decoration: none;height: 20px;line-height: 20px;"> <img src="/wzt/beian.png" />京公网安备 11010802030320号 </a> </p> <p>千锋教育 运营主体:北京千锋互联科技有限公司,属具备计算机技术培训资质的教育培训机构。</p> </div> </div> <script src="http://www.mobiletrain.org/js/jquery.min.js"></script> <script src="http://www.mobiletrain.org/js/swiper4.5.0.min.js"></script> <script src="http://www.mobiletrain.org/js/common1.js?111"></script> <script src="/js/highlight.min.js"></script> <script> hljs.highlightAll(); </script> <script> $(document).ready(function () { var href = $("#tag_click").attr("href"); if (href && href.indexOf("-0-") != -1) { var tag_code = $("#tag_click").html(); $.ajax({ url: "http://app.mobiletrain.org/tags.php", type: "get", dataType: "json", data: { tag_code: tag_code }, success: function (data) { $("#tag_click").attr( "href", "http://www.mobiletrain.org/tag-" + data + "-1.html" ); }, }); } }); if ( location.href.indexOf("/about/info/") > -1 || location.href.indexOf("/about/news/") > -1 ) { document .getElementsByClassName("topicactive")[0] .classList.remove("topicactive"); document .getElementsByClassName("interviewactive")[0] .classList.remove("interviewactive"); } else if (location.href.indexOf("/interview/") > -1) { document .getElementsByClassName("topicactive")[0] .classList.remove("topicactive"); document .getElementsByClassName("xwzxactive")[0] .classList.remove("xwzxactive"); } else { document .getElementsByClassName("xwzxactive")[0] .classList.remove("xwzxactive"); document .getElementsByClassName("interviewactive")[0] .classList.remove("interviewactive"); } new Swiper(".swiper1", { loop: true, autoplay: true, pagination: { el: ".swiper-pagination1", }, }); // new Swiper(".swiper3", { // slidesPerView: 14, // slidesPerGroup: 14, // spaceBetween: 20, // loop: true, // direction: "vertical", // // navigation: { // // nextEl: ".swiper-button-next3", // // prevEl: ".swiper-button-prev3", // // }, // }); // new Swiper(".swiper4", { // slidesPerView: 6, // slidesPerGroup: 6, // spaceBetween: 21, // loop: true, // direction: "vertical", // navigation: { // nextEl: ".swiper-button-next4", // prevEl: ".swiper-button-prev4", // }, // }); // new Swiper(".swiper-phone", { // slidesPerView: 4, // autoplay: true, // spaceBetween: 0, // loop: true, // direction: "vertical", // }); // $(".select_txt,.selet_open").hover(function (event) { // $(".option").hide(); // $(this).siblings(".option").show(); // $(".select_box").removeClass("uiChooseActiveS"); // $(this).parent(".select_box").addClass("uiChooseActiveS"); // }); // $(document).click(function (event) { // var eo = $(event.target); // if ( // $(".select_box").is(":visible") && // eo.attr("class") != "option" && // !eo.parent(".option").length // ) // $(".option").hide(); // $(".select_box").removeClass("uiChooseActiveS"); // }); // $(".option a").click(function () { // var value = $(this).text(); // $(this).parent().siblings(".select_txt").text(value); // $(".select_value").val(value); // $(".option").hide(); // $(".select_box").removeClass("uiChooseActiveS"); // }); // $(".option").each(function (d) { // var optionSize = 6; // var optionLiHeight = $(".option a").height(); // var optionVarS = $(this).find("a").length - 2; // console.log(optionVarS, optionSize); // if (optionVarS > optionSize) { // var optionSheight = 175; // $(this).height(optionSheight); // } else { // var optionLiTal = optionVarS * optionLiHeight; // $(this).height(optionLiTal); // } // }); // $(".option,.uiChooseTable,.mod_select ").mouseleave(function () { // $(".select_box").removeClass("uiChooseActiveS"); // $(".option").hide(); // }); // $(".option a").each(function () { // $(this).html("第" + $(this).text() + "页"); // }); new Swiper(".swiper-news", { autoplay: true, loop: true, direction: "vertical", }); $(".footer-link .links-tab span").click(function () { $(this).addClass("active").siblings().removeClass("active"); $(".footer-link .links-a").removeClass("active"); $(".footer-link .links-a").eq($(this).index()).addClass("active"); }); // 开班信息模块 function kbxx () { // var courseId = // arguments.length > 0 && arguments[0] !== undefined // ? arguments[0] // : 13; var cityId = arguments[0] !== undefined ? arguments[0] : 10; $.ajax({ url: "https://owzsapi.qfedu.com/v1/api/openApiRestController/getAllClass?type=1", type: "GET", success: function success (res) { var r = ""; var curTime = new Date().getTime(); var filterArr = res.data.filter(function (v) { return v.cityId == cityId; }); console.log(filterArr); filterArr.reverse().forEach(function (v, idx) { // 最大条数 if (idx > 14) return; // 判断时间 var timeMode = "预约占座"; var kbTime = new Date(v.beginTime).getTime(); // 一个月 if (kbTime - curTime > 2592000000) { timeMode = "预约占座"; } if (kbTime - curTime > 0 && kbTime - curTime < 2642268030) { timeMode = "即将报满"; } if (kbTime - curTime < 0) { timeMode = "爆满开班"; } r += "<li class='swiper-slide'>\n <a href='javascript:;' rel='nofollow' onclick='open53_pc()'>\n <span>" + (v.name.replace(v.cityName, "").split("班")[0] + "班") + "</span>\n <span>" + v.beginTime + "</span>\n <span data-mode='" + (timeMode === "即将报满" ? 0 : timeMode === "爆满开班" ? 2 : 1) + "'>" + timeMode + " " + (timeMode === "即将报满" ? "" : "") + "</span>\n </a>\n </li>"; }); $(".des-right-classes .swiper-wrapper").html(r); new Swiper(".swiper6", { slidesPerView: 5, slidesPerGroup: 5, spaceBetween: 10, loop: true, autoplay: true, direction: "vertical", }); }, }); } kbxx(10); $(".kbxx_showXq_btn").click(function () { $(".kbxx_showXq_box").css("display", "block"); }); $(".kbxx_showXq_box ul li").click(function () { kbxx($(this).data("cityid")); $(".choose-xq").html($(this).context.innerText); $(".kbxx_showXq_box").css("display", "none"); }); /******************表单提交start********************/ // (function () { // var timer = setInterval(function () { // if (window.$) { // clearInterval(timer); // $(".list-submit").click(function () { // var params = { // name: $("#realname").val(), // phone: $("#phone").val(), // }; // var phReg = /^[\u4e00-\u9fa5a-zA-Z0-9-]{2,20}$/; // var nameReg = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]8$/; // // if (!nameReg.test($("#realname").val())) { // // alert("请正确输入姓名"); // // return; // // } // if (!phReg.test($("#phone").val())) { // alert("请正确输入手机号"); // return; // } // $.ajax({ // type: "POST", // contentType: "application/json", // url: // "http://api-newzs.1000phone.net//v1/api/seoFormController/add", // data: JSON.stringify(params), // success: function success(res) { // alert(res.msg); // }, // }); // }); // } // }, 1000); // })(); /******************表单提交end********************/ console.log($(".content-left-box-child").height()); console.log($(".content-right-box-child").height()); if ( $(".content-left-box-child").height() > $(".content-right-box-child").height() ) { $(".content-right-box-child").addClass("sticky"); } else if ( $(".content-left-box-child").height() < $(".content-right-box-child").height() ) { $(".content-left-box-child").addClass("sticky"); } // var bot = // $(".con-right-rywd").offset().top + // $(".con-right-rywd").outerHeight() - // $(window).height() + // 30; // console.log(bot); // var left = $("#fixTop").offset().left; // $(document).scroll(function () { // var scroH = $(document).scrollTop(); // var footTop = $(".edu-footer").offset().top - $(window).height(); // if (scroH > bot) { // $("#fixTop").addClass("rig_fixed"); // $("#fixTop").css({ left: left }); // if (scroH > footTop) { // $("#fixTop").addClass("rig_bottom"); // $("#fixTop").css({ left: "909px" }); // } else { // $("#fixTop").removeClass("rig_bottom"); // // $("#fixTop").css({ left: "auto" }); // } // } else { // $("#fixTop").removeClass("rig_fixed"); // $("#fixTop").removeClass("rig_bottom"); // // $("#fixTop").css({ left: "auto" }); // } // }); </script> </body> </html>