DEV Community

loading...

Handling JavaScript Errors Like a boss by logging them to the server and possibly returning a behavior

mckabue profile image Kabue Charles ・1 min read

We make a request to your servers as if you are loading a JavaScript file. The url will contain the query parameters that you want to pass to the server.
This method has two advantages:

  1. The code for sending the request is simple as we are just creating/changing the script tag src
  2. We can return some behavior back to the browser from the server possibly redirecting users to some other location

Discussion

pic
Editor guide