error.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  6. <meta name="HandheldFriendly" content="true"/>
  7. <meta name="MobileOptimized" content="320"/>
  8. <title>Error</title>
  9. <script type="text/javascript">
  10. // H5 plus事件处理
  11. var ws=null;
  12. function plusReady(){
  13. // Android处理返回键
  14. plus.key.addEventListener('backbutton',function(){
  15. (history.length==1)&&ws.close();
  16. var c=setTimeout(function(){
  17. ws.close();
  18. },1000);
  19. window.onbeforeunload=function(){
  20. clearTimeout(c);
  21. }
  22. history.go(-2);
  23. },false);
  24. ws=plus.webview.currentWebview();
  25. }
  26. if(window.plus){
  27. plusReady();
  28. }else{
  29. document.addEventListener('plusready',plusReady,false);
  30. }
  31. document.addEventListener('touchstart',function(){
  32. return false;
  33. },true);
  34. // 禁止选择
  35. document.oncontextmenu=function(){
  36. return false;
  37. };
  38. // 获取错误信息
  39. document.addEventListener("error",function(e){
  40. info.innerText="请求的页面("+e.url+")无法打开";
  41. console.log("请求的页面无法打开:"+e.href);
  42. },false);
  43. </script>
  44. <style>
  45. *{
  46. -webkit-user-select: none;
  47. }
  48. html,body{
  49. margin: 0px;
  50. padding: 0px;
  51. width: 100%;
  52. height: 100%;
  53. text-align: center;
  54. word-break: break-all;
  55. -webkit-touch-callout:none;
  56. -webkit-tap-highlight-color:rgba(0,0,0,0);
  57. }
  58. .button{
  59. width: 50%;
  60. font-size: 18px;
  61. font-weight: normal;
  62. text-decoration: none;
  63. text-align: center;
  64. padding: .5em 0em;
  65. margin: .5em auto;
  66. color: #333333;
  67. background-color: #EEEEEE;
  68. border: 1px solid #CCCCCC;
  69. -webkit-border-radius: 5px;
  70. border-radius: 5px;
  71. }
  72. .button:active{
  73. background-color: #CCCCCC;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div style="width:100%;height:20%;"></div>
  79. <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 512 512" style="height:20%;width:30%">
  80. <path d="M256 0c-141.385 0-256 114.615-256 256s114.615 256 256 256 256-114.615 256-256-114.615-256-256-256zM352 128c17.673 0 32 14.327 32 32s-14.327 32-32 32-32-14.327-32-32 14.327-32 32-32zM160 128c17.673 0 32 14.327 32 32s-14.327 32-32 32-32-14.327-32-32 14.327-32 32-32zM352.049 390.37c-19.587-32.574-55.272-54.37-96.049-54.37s-76.462 21.796-96.049 54.37l-41.164-24.698c27.98-46.535 78.958-77.672 137.213-77.672s109.232 31.137 137.213 77.672l-41.164 24.698z" fill="#666666"></path>
  81. </svg>
  82. <p style="font-size:18px;font-weight:bolder;">We're sorry ...</p>
  83. <p id="info" style="font-size:12px;"></p>
  84. <!--<div class="button" onclick="history.back()">Retry</div>-->
  85. <div class="button" onclick="if(history.length == 1){ws.close();}else{ws.back();ws.back();}">Back</div>
  86. <div class="button" onclick="ws.close()">Close</div>
  87. <div class="button" onclick="plus.runtime.restart()">Restart</div>
  88. </body>
  89. </html>