首页 > 其他 > 详细

依赖于脚本支持的应用程序

时间:2014-09-18 18:35:04      阅读:267      评论:0      收藏:0      [点我收藏+]

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example:Replacing noscript</title>
  <script type="text/javascript">
  function noscript()
  {
      if(!document.getElementById||!document.createTextNode){return;}
      var noJSmsg=document.getElementById(‘noscripting‘);
      if(!noJSmsg){return;}
      var headline=‘Browser test succeeded‘;
      replaceMessage=‘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.‘;
      var linkMessage=‘Proceed to application.‘;
      var head=document.createElement(‘h1‘);
      head.appendChild(document.createTextNode(headline));
      noJSmsg.parentNode.insertBefore(head,noJSmsg);
      var infoPara=document.createElement(‘p‘);
      infoPara.appendChild(document.createTextNode(replaceMessage));
      noJSmsg.parentNode.insertBefore(infoPara,noJSmsg);
      var linkPara=document.createElement(‘p‘);
      var appLink=document.createElement(‘a‘);
      appLink.setAttribute(‘href‘,‘application.aspx‘);
      appLink.appendChild(document.createTextNode(linkMessage));
      linkPara.appendChild(appLink);
      noJSmsg.parentNode.replaceChild(linkPara,noJSmsg);
  }
  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>

 

bubuko.com,布布扣

bubuko.com,布布扣

依赖于脚本支持的应用程序

原文:http://www.cnblogs.com/vonk/p/3979648.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!