This is probably the one I see the most often. Some web developers obviously see that it would be cool if they could embed links on their page that would send the site’s visitor to another page when they click it.
And I agree. It’s just that the web browser already knows how to do this.
Here’s an example:
<a href="https://volse.net/~haraldei">Link to my homepage</a>.
This rather simple code tells the web browser all that it needs to render the link appropriately, and where the user should be taken when the link is clicked.
In addition it may offer further functionality, like revelaing the actual destination address when hovering above the link with the mouse, or allowing the web browser to list all the links on a page in a menu to make it easier for a visitor to select the right one.
Submitting a form
This is completely unneccessary, so please stop!
<form action="/process-form" method="POST"> <input type="text" name="my-form-field"> <input type="submit" name="Submit form"> </form>
That’s it. No need to doenload or run any extra code at all.
Redrecting to another page
Again, this one s rather common. There’s many reasons you may need to redirect your visitor to another page on your site. For example to log back in if the visitors session has expired. The people who wrote the HTTP protocol recognized this, and baked it in directly at the protocol layer.
Just return a response like this to the web browser or client, and it is already taken care of:
HTTP/1.1 302 Found location: https://new-url.com
These examples are by no means extensive, but are some of the issues that I see with a lot of websites. There’s also another class of issues that you should not do, like changing the behaviour of the web browser by overriding default keybindings etc. That’s not what I wanted to cover in this quick post though.