zoukankan      html  css  js  c++  java
  • 通过innerHTML简化脚本

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <title>Example:InnerHTML</title>
      <script type="text/javascript">
      function noscript()
      {
          if(!document.getElementById||!document.createTextNode){return;}
          var noJSmsg=document.getElementById('noscripting');
          if(!noJSmsg){return;}
          var replaceMessage='<h1>Browser test succeeded(From InnerHTML)<h1>';
          replaceMessage='<p>We tested if your browser is capable of ';
          replaceMessage+='supporting the application,and all checked out fine.';
          replaceMessage+='Please proceed by activating the following link.</p>';
          replaceMessage+='<p><a href="application.aspx"> Proceed to application</a></p>';
          noJSmsg.innerHTML=replaceMessage;
      }
      window.onload=noscript;
      </script>
    </head>
    <body>
      <p id="noscripting">
      We are sorry,but this application needs JavaScript to be
      enabled to work.Please <a href="contact.html">contact us</a>
      if you cannot enable scripting and we will try to help you in
      other ways
      </p>
    </body>
    </html>

    ERROR:

    image

  • 相关阅读:
    列表推导式,生成器表达式
    迭代器,生成器初始
    装饰器的进阶
    函数名用途,初始装饰器
    函数参数,和空间
    py文件的操作
    字符串相关操作
    python基础二
    Django简介
    Django初识
  • 原文地址:https://www.cnblogs.com/vonk/p/3979698.html
Copyright © 2011-2022 走看看