Many people surely know all this by now. Still, here are some things I’ve recently learned about notifying clients (browsers, API clients) about errors. Delivering errors from route handlers to clients This is remarkably easy, once you figure it out. Just use the http-errors package. (Beware, not the http-error package; it does something different. Call next() with an object made… Read more →
Category: Javascript
Debugging web page code on Android from desktop machines
I needed to do some simple web-page / Javascript debugging work on an Android device. My need was simple: look at the console log. But setting things up to do it was not simple. It didn’t help that most of the online information about this is buried in edits to years-old Stack Overflow answers. Desired Result When it’s set up… Read more →
From browser Javascript, how to tell if an image won’t load
Sometimes it’s necessary in Javascript in a browser to find out whether an image object loads correctly. You might do this to check whether a server is responding, or whether it’s blocked by a firewall. In plain HTML you would load the image like this <img src=”/maybe.png” /> then look for the browser’s broken-image indicator visually. You can do this… Read more →
Which iframe posted a message to my window?
What do you do if you have a bunch of different iframes in your web page posting messages? How do you know which iframe a message came from? Even if the iframe document comes from a different origin? This does the trick Read more →