Guest User

Untitled

a guest
Jul 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <div id="errors" style="
  2. background: #c00;
  3. color: #fff;
  4. display: none;
  5. margin: -20px -20px 20px;
  6. padding: 20px;
  7. white-space: pre-wrap;
  8. "></div>
  9.  
  10. <div id="set">
  11. <a href="href1" name="setting">设置</a>
  12. <a href="href2" name="login" >登录</a></div>
  13.  
  14. <div id="title">百川引擎</div><br/>
  15.  
  16. <div id="page"></div>
  17.  
  18. <script>
  19. window.addEventListener('mousedown', function(e) {
  20. document.body.classList.add('mouse-navigation');
  21. document.body.classList.remove('kbd-navigation');
  22. });
  23. window.addEventListener('keydown', function(e) {
  24. if (e.keyCode === 9) {
  25. document.body.classList.add('kbd-navigation');
  26. document.body.classList.remove('mouse-navigation');
  27. }
  28. });
  29. window.addEventListener('click', function(e) {
  30. if (e.target.tagName === 'A' && e.target.getAttribute('href') === '#') {
  31. e.preventDefault();
  32. }
  33. });
  34. window.onerror = function(message, source, line, col, error) {
  35. var text = error ? error.stack || error : message + ' (at ' + source + ':' + line + ':' + col + ')';
  36. errors.textContent += text + '\n';
  37. errors.style.display = '';
  38. };
  39. console.error = (function(old) {
  40. return function error() {
  41. errors.textContent += Array.prototype.slice.call(arguments).join(' ') + '\n';
  42. errors.style.display = '';
  43. old.apply(this, arguments);
  44. }
  45. })(console.error);
  46. </script>
Add Comment
Please, Sign In to add comment