根据输入值计算最大值、最小值和平均值 [英] Calculate maximum, minimum and average from input values

查看:55
本文介绍了根据输入值计算最大值、最小值和平均值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建 6 个由 制成的文本框,前 3 个作为输入,后 3 个作为输出.三个输入文本框读取 3 个数字.单击计算按钮时,应计算出 3 个输入数字的最大值、最小值和平均值,并显示在带有相应标签的文本框中.我的代码不起作用有什么原因吗?

I'm trying to create 6 textboxes made from , top 3 serve as input, bottom 3 serve as the output. Three input textboxes read 3 numbers. When the Calculate button is clicked, the maximum, minimum, and average of 3 input numbers should be calculated and displayed in the textbox with corresponding label. Is there a reason why my code doesn't work?

function maximum() //find the max
{
  var max;
  if (document.getElementsByTagName("input")[0].value > document.getElementsByTagName("input")[1].value && document.getElementsByTagName("input")[0].value > document.getElementsByTagName("input")[2].value) {
    max = document.getElementsByTagName("input")[0].value;
  } else if (document.getElementsByTagName("input")[1].value > document.getElementsByTagName("input")[0].value && document.getElementsByTagName("input")[1].value > document.getElementsByTagName("input")[2].value) {
    max = document.getElementsByTagName("input")[1].value;
  } else {
    max = document.getElementsByTagName("input")[2].value;
  }
  document.getElementsByTagName("output")[0] = max;

  //alert(maximumDemo.innerHTML);
}

function average() //find the average
{
  var total = 3;
  var i, aver;
  aver = (document.getElementsByTagName("input")[0].value + (document.getElementsByTagName("input")[1].value + (document.getElementsByTagName("input")[2].value))) / total;
  document.getElementsByTagName("output")[1] = aver;
}

function minimum() {
  if (document.getElementsByTagName("input")[0].value < document.getElementsByTagName("input")[1].value && document.getElementsByTagName("input")[0].value < document.getElementsByTagName("input")[2].value) {
    min = document.getElementsByTagName("input")[0].value;
  } else if (document.getElementsByTagName("input")[1].value < document.getElementsByTagName("input")[0].value && document.getElementsByTagName("input")[1].value < document.getElementsByTagName("input")[2].value) {
    min = document.getElementsByTagName("input")[1].value;
  } else {
    min = document.getElementsByTagName("input")[2].value;
  }
  document.getElementsByTagName("output")[2] = min; //find the minimum

  //alert(minimumDemo.innerHTML);
}

<form>
  Number 1: <input type="text" name="num1"> <br> Number 2: <input type="text" name="num2"> <br> Number 3: <input type="text" name="num3"> <br> Maximum: <output type="text" name="max"></output> <br>
  <!--preferably in textbox form-->
  Average: <output type="text" name="avg"></output> <br>
  <!--preferably in textbox form-->
  Minimum: <output type="text" name="min"></output> <br>
  <!--preferably in textbox form-->
  <br><br>
</form>
<button onCLick="maximum();average();minimum();">Calculate</button>

推荐答案

您有几个问题,但最大的是您试图将 output 元素本身设置为你的数学问题而不是设置.textContent 你的元素的代码到你的数学答案.

You have several problems, but the biggest was that you were attempting to set your output elements themselves to the answers to your math problems instead of setting the .textContent of your elements to the answers to your math.

现在,既然您刚刚学习了所有这些,让我们在它们变得一成不变之前改掉一些坏习惯.毫无疑问,您已经从其他人使用的代码中复制了大部分代码,不幸的是,网络上的大多数代码都是以这种方式创建的,而不是由真正了解他们所写内容的人创建的.

Now, since you are just learning all of this, let's break some bad habits before they become set in stone. No doubt you've copied much of your code from what you've seen others use and, unfortunately, most of the code on the web gets created this way and not by people who really understand what they are writing.

考虑到这一点...

不要通过 HTML 事件属性设置事件处理程序(即 onclickonmouseover 等).这是一项已有 25 年历史的技术,我们在拥有现代标准和最佳实践之前就使用了它,而且由于它易于使用,人们一直在使用它.但是有多种原因导致您不应使用这种技术,而应将 JavaScript 与 HTML 分开.相反,将您的 JavaScript 分开并使用 .addEventListener() 将您的元素连接到它们各自的回调函数.

Do not set up event handlers via HTML event attributes (i.e. onclick, onmouseover, etc.). This is a 25+ year old technique that we used before we had modern standards and best practices and because it's easy to use, people keep using it. But there are a variety of reasons why you should not use this technique and instead separate your JavaScript from your HTML. Instead, keep your JavaScript separate and use .addEventListener() to hook up your elements to their respective callback functions.

只需获取一次元素引用,而不是每次运行函数时,因为扫描文档中的元素需要时间和资源.没有理由一遍又一遍地扫描相同的元素.

Just get your element references once, not every time you run your functions because scanning the document for an element takes time and resources. There's no reason to keep scanning for the same element over and over.

与此有关.小心.getElementsByTagName() 因为它返回一个活动节点列表",这意味着它必须重新扫描文档以确保它的列表保持最新.这在性能方面可能非常浪费.相反,.getElementById().querySelector().querySelectorAll() 应该是扫描单个元素或元素组的最常用方法.

Related to that. Be careful with .getElementsByTagName() as it returns a "live node list", which means that it has to re-scan the document to ensure that it keeps its list up to date. This can be extremely wasteful in terms of performance. Instead, .getElementById(), .querySelector() and .querySelectorAll() should probably be the most common ways to scan for individual elements or groups of elements.

output 元素没有 HTML type 属性.inputbutton 元素允许设置 type.输出 纯粹是一个语义元素,就所有意图和目的而言,在功能上与 span 元素没有太大区别.这只是让浏览器知道它将包含页面设计者认为是来自任何地方的某种输出的内容的一种方式.任何桌面版本的 IE 也不支持它(如果这对您很重要).你使用它很好,但我认为你误解了它是什么以及它是如何使用的.

The output element doesn't have an HTML type attribute. input and button elements allow for setting the type. output is purely a semantic element, and for all intents and purposes, not that much functionally different from a span element. It's just a way for the browser to know that it will contain something that the page designer deems as some kind of output, from anywhere. It's also not supported in any desktop version of IE (if that matters to you). It's fine that you are using it, but I think you misunderstand what it's for an how it's used.

您的解决方案中确实不需要任何 if/then 代码,因为 JavaScript 具有内置的 Math 对象,它具有 .max.min 方法完全符合您的要求.

You really don't need any if/then code in your solution because JavaScript has a built-in Math object, which has .max and .min methods that do exactly what you are attempting.

请记住,HTML 中的T"代表文本".无论您认为您在表单字段中输入什么,它都会作为文本处理,当 JavaScript 获取该值时,它也会将其作为文本进行处理.而且,在 JavaScript 中,+ 运算符可以表示字符串连接,也可以表示数学加法.它执行哪一个取决于操作数是什么.如果操作数之一是字符串,则完成字符串连接.因此,在对它们进行任何数学运算之前,您需要将 input 元素中的数据转换为数字.这可以通过多种方式(隐式和显式)完成,但一种简单的方法是在可转换为数字的字符串前添加 + 运算符,您将在下面是我的平均代码.

Remember that the "T" in HTML stands for "Text". No matter what you think you are entering into a form field, it is processed as text and when JavaScript obtains that value, it processes it as text as well. And, in JavaScript the + operator can mean string concatenation or it can mean mathematical addition. Which one it does depends on what the operands are. If one of the operands is a string then string concatenation is done. So, you need to convert the data in your input elements to numbers before you do any math on them. This can be done in a variety of ways (implicit and explicit), but one simple way is to prepend a + operator in front of a string that is convertible to a number and you'll see that in my average code below.

最后(这不会导致您的代码无法工作,但您应该知道),每个 HTML 文档都必须在 < 之前有一个 <head> 部分.body> 部分中必须有一个非空的 </code> 元素,文档才能被认为是有效的.浏览器不验证 HTML,它们只是跳过它们不理解的 HTML.这意味着您很可能在浏览器中拥有一个对您有效"的网页,但在技术上是不正确的.始终在 <strong><a href="http://validator.w3.org" rel="noreferrer">http://validator.w3.org</a></strong> 验证您的 HTML 以确保它是正确的.<em class="showen"></em></p> <p class="en">Lastly (and this wasn't causing your code to not work, but you should know), every HTML document must have a <code><head></code> section just prior to the <code><body></code> and the <code><head></code> section must have a non-empty <code><title></code> element within it for the document to be considered valid. Browsers don't validate HTML, they simply skip HTML that they don't understand. This means that you could very well have a web page that "works" for you in your browser, but is technically incorrect. Always validate your HTML at <strong>http://validator.w3.org</strong> to ensure it's correct.</p> <p class="cn"></p> <div class="cn"></div> <div class="cn"></div> <pre><code><code><!doctype html> <html> <head> <title>Basic JavaScript 101</title> </head> <body> <form> Number 1: <input type="text" name="num1"> <br> Number 2: <input type="text" name="num2"> <br> Number 3: <input type="text" name="num3"> <br> Maximum: <output id="max"></output> <br> <!-- output should not be in input type elements --> Average: <output id="avg"></output> <br> <!-- output should not be in input type elements --> Minimum: <output id="min"></output> <br> <!-- output should not be in input type elements --> <br><br> </form> <button type="button" id="calc">Calculate</button> <script> // Get references to the elements just once var num1 = document.querySelector("[name='num1']"); var num2 = document.querySelector("[name='num2']"); var num3 = document.querySelector("[name='num3']"); var max = document.getElementById("max"); var avg = document.getElementById("avg"); var min = document.getElementById("min"); var btn = document.getElementById("calc"); // Set up your event handler(s) in JavaScript, not with HTML attributes btn.addEventListener("click", function(){ maximum(); average(); minimum(); }); function maximum() { // You can't just set an element to a value. You have to set the content of the // element to a value. Also, JavaScript provides a built-in Math object that // can get you the maximum number from a set of numbers. No if/then needed. max.textContent = Math.max(num1.value, num2.value, num3.value); } function average() { // Convert values to numbers and do math avg.textContent = (+num1.value + +num1.value + +num3.value) / 3 } function minimum() { // You can't just set an element to a value. You have to set the content of the // element to a value. Math can also get you the minimum number in a set: min.textContent = Math.min(num1.value, num2.value, num3.value); } </script> </body> </html></code></code></pre> <p class="cn"></p> <p class="cn"></p> <p class="cn"></p> <p>这篇关于根据输入值计算最大值、最小值和平均值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!</p> </div> <div class="arc-body-main-more"> <span onclick="unlockarc('2480398');">查看全文</span> </div> </div> <div> </div> <div class="wwads-cn wwads-horizontal" data-id="166" style="max-width:100%;border: 4px solid #666;"></div> </div> </article> <div id="arc-ad-2" class="mb-1"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5038752844014834" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5038752844014834" data-ad-slot="3921941283"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <div class="widget bgwhite radius-1 mb-1 shadow widget-rel"> <h5>相关文章</h5> <ul> <li> <a target="_blank" title="计算输入数字的最小值,最大值和平均值" href="/1782302.html"> 计算输入数字的最小值,最大值和平均值; </a> </li> <li> <a target="_blank" title="如何计算最小值,最大值,总和和平均值" href="/1612309.html"> 如何计算最小值,最大值,总和和平均值; </a> </li> <li> <a target="_blank" title="查找列表的最小值、最大值和平均值" href="/2300298.html"> 查找列表的最小值、最大值和平均值; </a> </li> <li> <a target="_blank" title="查找嵌套列表的最小值,最大值和平均值?" href="/1566652.html"> 查找嵌套列表的最小值,最大值和平均值?; </a> </li> <li> <a target="_blank" title="查找输入值的平均值,最大值和最小值" href="/1955975.html"> 查找输入值的平均值,最大值和最小值; </a> </li> <li> <a target="_blank" title="在F#中查找最大值,最小值和平均值" href="/2074541.html"> 在F#中查找最大值,最小值和平均值; </a> </li> <li> <a target="_blank" title="如何从表格中显示最大值、最小值、中值和平均值" href="/2431387.html"> 如何从表格中显示最大值、最小值、中值和平均值; </a> </li> <li> <a target="_blank" title="如何从通用 ArrayList 中找到最小值、最大值和平均值" href="/2580549.html"> 如何从通用 ArrayList 中找到最小值、最大值和平均值; </a> </li> <li> <a target="_blank" title="如何从通用 ArrayList 中找到最小值、最大值和平均值" href="/2428294.html"> 如何从通用 ArrayList 中找到最小值、最大值和平均值; </a> </li> <li> <a target="_blank" title="在C ++中查找矩阵的最大值,最小值和平均值" href="/497025.html"> 在C ++中查找矩阵的最大值,最小值和平均值; </a> </li> <li> <a target="_blank" title="查找文本文件的最小值、最大值和平均值" href="/2437123.html"> 查找文本文件的最小值、最大值和平均值; </a> </li> <li> <a target="_blank" title="如何从通用 ArrayList 中找到最小值、最大值和平均值" href="/2580290.html"> 如何从通用 ArrayList 中找到最小值、最大值和平均值; </a> </li> <li> <a target="_blank" title="查找数组的最小最大值和平均值" href="/1612314.html"> 查找数组的最小最大值和平均值; </a> </li> <li> <a target="_blank" title="如何在不同方法中输入最小值,最大值和平均值的命令" href="/1148987.html"> 如何在不同方法中输入最小值,最大值和平均值的命令; </a> </li> <li> <a target="_blank" title="从Java中的数组计算平均值/最大值/最小值" href="/1977331.html"> 从Java中的数组计算平均值/最大值/最小值; </a> </li> <li> <a target="_blank" title="如何在Solr.net中使用最小值,最大值和平均值" href="/1584154.html"> 如何在Solr.net中使用最小值,最大值和平均值; </a> </li> <li> <a target="_blank" title="Java8:从列表到地图收集最小值,最大值和平均值" href="/2145419.html"> Java8:从列表到地图收集最小值,最大值和平均值; </a> </li> <li> <a target="_blank" title="R - 矩阵中非对角线元素的最小值、最大值和平均值" href="/2791033.html"> R - 矩阵中非对角线元素的最小值、最大值和平均值; </a> </li> <li> <a target="_blank" title="如何在mongodb查询中计算平均值、中值、最小值、最大值?" href="/2304668.html"> 如何在mongodb查询中计算平均值、中值、最小值、最大值?; </a> </li> <li> <a target="_blank" title="C 中的平均值、最大值和最小值程序" href="/2483576.html"> C 中的平均值、最大值和最小值程序; </a> </li> <li> <a target="_blank" title="sqlalchemy:从表中获取最大值/最小值/平均值" href="/2408367.html"> sqlalchemy:从表中获取最大值/最小值/平均值; </a> </li> <li> <a target="_blank" title="添加/编辑Javascript程序来计算数组元素的最小值,最大值,总计和平均值" href="/880577.html"> 添加/编辑Javascript程序来计算数组元素的最小值,最大值,总计和平均值; </a> </li> <li> <a target="_blank" title="在 Java 8 中查找列表的最大值、最小值、总和和平均值" href="/2709431.html"> 在 Java 8 中查找列表的最大值、最小值、总和和平均值; </a> </li> <li> <a target="_blank" title="在Java 8中查找列表的最大值,最小值,总和和平均值" href="/968337.html"> 在Java 8中查找列表的最大值,最小值,总和和平均值; </a> </li> <li> <a target="_blank" title="Python查找列表的最小最大值和平均值(数组)" href="/1612045.html"> Python查找列表的最小最大值和平均值(数组); </a> </li> </ul> </div> <div class="mb-1"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5038752844014834" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5038752844014834" data-ad-slot="3921941283"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="side"> <div class="widget widget-side bgwhite mb-1 shadow"> <h5>前端开发最新文章</h5> <ul> <li> <a target="_blank" title="为什么Chrome(在Electron内部)突然重定向到chrome-error:// chromewebdata?" href="/1996151.html"> 为什么Chrome(在Electron内部)突然重定向到chrome-error:// chromewebdata?; </a> </li> <li> <a target="_blank" title="错误102(net :: ERR_CONNECTION_REFUSED):服务器拒绝连接" href="/749568.html"> 错误102(net :: ERR_CONNECTION_REFUSED):服务器拒绝连接; </a> </li> <li> <a target="_blank" title="如何解决'重定向已被CORS策略阻止:没有'Access-Control-Allow-Origin'标题'?" href="/1009885.html"> 如何解决'重定向已被CORS策略阻止:没有'Access-Control-Allow-Origin'标题'?; </a> </li> <li> <a target="_blank" title="如何处理“Uncaught(in promise)DOMException:play()失败,因为用户没有首先与文档交互。”在桌面上使用Chrome 66?" href="/884909.html"> 如何处理“Uncaught(in promise)DOMException:play()失败,因为用户没有首先与文档交互。”在桌面上使用Chrome 66?; </a> </li> <li> <a target="_blank" title="警告:添加非被动事件侦听器到滚动阻塞'touchstart'事件" href="/818517.html"> 警告:添加非被动事件侦听器到滚动阻塞'touchstart'事件; </a> </li> <li> <a target="_blank" title="如何在浏览器中播放.TS文件(视频/ MP2T媒体类型)?" href="/343346.html"> 如何在浏览器中播放.TS文件(视频/ MP2T媒体类型)?; </a> </li> <li> <a target="_blank" title="此请求已被阻止;内容必须通过HTTPS提供" href="/886417.html"> 此请求已被阻止;内容必须通过HTTPS提供; </a> </li> <li> <a target="_blank" title="资源解释为样式表,但转换为MIME类型text / html(似乎与web服务器无关)" href="/562873.html"> 资源解释为样式表,但转换为MIME类型text / html(似乎与web服务器无关); </a> </li> <li> <a target="_blank" title="通过HTTPS加载页面但请求不安全的XMLHttpRequest端点" href="/885901.html"> 通过HTTPS加载页面但请求不安全的XMLHttpRequest端点; </a> </li> <li> <a target="_blank" title="拒绝从执行脚本'*',因为它的MIME类型(“应用/ JSON')不是可执行文件,并严格MIME类型检查被启用。" href="/47347.html"> 拒绝从执行脚本'*',因为它的MIME类型(“应用/ JSON')不是可执行文件,并严格MIME类型检查被启用。; </a> </li> </ul> </div> <div class="widget widget-side bgwhite mb-1 shadow"> <h5> 热门教程 </h5> <ul> <li> <a target="_blank" title="Java教程" href="/OnLineTutorial/java/index.html"> Java教程 </a> </li> <li> <a target="_blank" title="Apache ANT 教程" href="/OnLineTutorial/ant/index.html"> Apache ANT 教程 </a> </li> <li> <a target="_blank" title="Kali Linux教程" href="/OnLineTutorial/kali_linux/index.html"> Kali Linux教程 </a> </li> <li> <a target="_blank" title="JavaScript教程" href="/OnLineTutorial/javascript/index.html"> JavaScript教程 </a> </li> <li> <a target="_blank" title="JavaFx教程" href="/OnLineTutorial/javafx/index.html"> JavaFx教程 </a> </li> <li> <a target="_blank" title="MFC 教程" href="/OnLineTutorial/mfc/index.html"> MFC 教程 </a> </li> <li> <a target="_blank" title="Apache HTTP客户端教程" href="/OnLineTutorial/apache_httpclient/index.html"> Apache HTTP客户端教程 </a> </li> <li> <a target="_blank" title="Microsoft Visio 教程" href="/OnLineTutorial/microsoft_visio/index.html"> Microsoft Visio 教程 </a> </li> </ul> </div> <div class="widget widget-side bgwhite mb-1 shadow"> <h5> 热门工具 </h5> <ul> <li> <a target="_blank" title="Java 在线工具" href="/Onlinetools/details/4"> Java 在线工具 </a> </li> <li> <a target="_blank" title="C(GCC) 在线工具" href="/Onlinetools/details/6"> C(GCC) 在线工具 </a> </li> <li> <a target="_blank" title="PHP 在线工具" href="/Onlinetools/details/8"> PHP 在线工具 </a> </li> <li> <a target="_blank" title="C# 在线工具" href="/Onlinetools/details/1"> C# 在线工具 </a> </li> <li> <a target="_blank" title="Python 在线工具" href="/Onlinetools/details/5"> Python 在线工具 </a> </li> <li> <a target="_blank" title="MySQL 在线工具" href="/Onlinetools/Dbdetails/33"> MySQL 在线工具 </a> </li> <li> <a target="_blank" title="VB.NET 在线工具" href="/Onlinetools/details/2"> VB.NET 在线工具 </a> </li> <li> <a target="_blank" title="Lua 在线工具" href="/Onlinetools/details/14"> Lua 在线工具 </a> </li> <li> <a target="_blank" title="Oracle 在线工具" href="/Onlinetools/Dbdetails/35"> Oracle 在线工具 </a> </li> <li> <a target="_blank" title="C++(GCC) 在线工具" href="/Onlinetools/details/7"> C++(GCC) 在线工具 </a> </li> <li> <a target="_blank" title="Go 在线工具" href="/Onlinetools/details/20"> Go 在线工具 </a> </li> <li> <a target="_blank" title="Fortran 在线工具" href="/Onlinetools/details/45"> Fortran 在线工具 </a> </li> </ul> </div> </div> </div> <script type="text/javascript">var eskeys = '根据,输入,值,计算,最大值,最小值,和平,均值'; var cat = 'cc';';//qianduan</script> </div> <div id="pop" onclick="pophide();"> <div id="pop_body" onclick="event.stopPropagation();"> <h6 class="flex flex101"> 登录 <span onclick="pophide();">关闭</span> </h6> <div class="pd-1"> <div class="wxtip center"> <span>扫码关注<em>1秒</em>登录</span> </div> <div class="center"> <img id="qr" src="https://huajiakeji.com/Content/Images/qrydx.jpg" alt="" style="width:150px;height:150px;" /> </div> <div style="margin-top:10px;display:flex;justify-content: center;"> <input type="text" placeholder="输入验证码" id="txtcode" autocomplete="off" /> <input id="btngo" type="button" onclick="chk()" value="GO" /> </div> <div class="center" style="margin: 4px; font-size: .8rem; color: #f60;"> 发送“验证码”获取 <em style="padding: 0 .5rem;">|</em> <span style="color: #01a05c;">15天全站免登陆</span> </div> <div id="chkinfo" class="tip"></div> </div> </div> </div> <script type="text/javascript" src="https://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> <script type="text/javascript" src="https://img01.yuandaxia.cn/Scripts/highlight.min.js"></script> <script type="text/javascript" src="https://img01.yuandaxia.cn/Scripts/base.js?v=0.22"></script> <script type="text/javascript" src="https://img01.yuandaxia.cn/Scripts/tui.js?v=0.11"></script> <footer class="footer"> <div class="container"> <div class="flink mb-1"> 友情链接: <a href="https://www.it1352.com/" target="_blank">IT屋</a> <a href="https://huajiakeji.com/" target="_blank">Chrome插件</a> <a href="https://www.cnplugins.com/" target="_blank">谷歌浏览器插件</a> </div> <section class="copyright-section"> <a href="https://www.it1352.com" title="IT屋-程序员软件开发技术分享社区">IT屋</a> ©2016-2022 <a href="http://www.beian.miit.gov.cn/" target="_blank">琼ICP备2021000895号-1</a> <a href="/sitemap.html" target="_blank" title="站点地图">站点地图</a> <a href="/Home/Tags" target="_blank" title="站点标签">站点标签</a> <a target="_blank" alt="sitemap" href="/sitemap.xml">SiteMap</a> <a href="/1155981.html" title="IT屋-免责申明"><免责申明></a> 本站内容来源互联网,如果侵犯您的权益请联系我们删除. </section> <!--统计代码--> <script type="text/javascript"> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?0c3a090f7b3c4ad458ac1296cb5cc779"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script type="text/javascript"> (function () { var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </div> </footer> </body> </html>