Skip to content
  • Categories
  • Recent
  • Groups
  • Users
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Zephyr)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Web Development
  3. How to display errors on web browsers without dev tools (like the Switch)

How to display errors on web browsers without dev tools (like the Switch)

Scheduled Pinned Locked Moved Web Development
1 Posts 1 Posters 175 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • VGMoose
    VGMoose
    VGMoose
    Admin
    wrote on last edited by
    #1

    If you're working on a website for a console that doesn't have a modern browser, or web dev tools, and can't figure out why something is broken on the console, the following HTML snippet can be used to display and alert any javascript errors:

    <script>
       window.onerror = function(message, source, lineno, colno, error) {
          alert(`Error: ${message}\nSource: ${source}\nLine: ${lineno}\nColumn: ${colno}\nError object: ${error}`);
          return false;
       };  
    </script>
    

    This will only help for websites where you can control the source code. It displays whatever errored on the page, and the filename and line number that generated it.

    Sign the browser petition! Or visit my site at vgmoose.dev.

    1 Reply Last reply
    1

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better ๐Ÿ’—

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Groups
    • Users
    • Tags
    • Popular