码迷,mamicode.com
首页 > Web开发 > 详细

通过innerHTML简化脚本

时间:2014-09-18 18:34:44      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   os   java   ar   2014   

<!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:

bubuko.com,布布扣

通过innerHTML简化脚本

标签:style   blog   http   color   io   os   java   ar   2014   

原文地址:http://www.cnblogs.com/vonk/p/3979698.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!