Bug Squished

On at least one previous occasion in this dev diary, I’ve referred to a bug in the species list that I’d managed to convince myself was a bug in Google Chrome. It wasn’t. In fact, a number of different browsers were behaving a bit strangely, often inconsistently with each other. Chrome would fail to render the last items in the list as hyperlinks, as in the screenshot above. Firefox did exactly the same thing. Safari got as far as Ursidae, and then gave up rendering the rest of the list entirely. Incredibly, the one browser that did manage to display the entire list correctly was Edge. All the links in the list are automatically generated by the same code which loops around the database until there are no more records left to process, so in theory, if the previous 100’s of links were ok, then so should the last 7 or 8. It turned out to be my code that was the problem. The PHP code constructs the HTML code, which the browser then renders. In this case a small bit of sloppy coding (a missing closing tag) was being repeated x amount of times for every item in the list. Browsers can be very forgiving sometimes when it comes to code that isn’t properly formed. It seems that by the time my list had reached ‘Varanidae’, most browsers had given up hoping that my code was ever going to right itself, and each one exhibited its issues with my code in different ways. Anyway, a simple insertion of the missing tag resolved the problem, and all browsers now correctly render the list in its entirety. Whilst I was surprised that Edge didn’t seem to care about my mistake, I’m less surprised that now it’s fixed, Edge handles this page much worse than any other browser, none of which have any problems at all! Fortunately, Microsoft are about to release a new version of Edge which is built on the Chrome engine.

Previous Post

Filters, sorting and orders

I've added some more new functionality to the species list. Firstly, it is possible to completely hide the thumbnails, or to shrink them so that they don't make the page any longer than it needs to be. Previously, the list was sorted automatically first by class, then by common name ... Read more

Next Post

Species list - more filters

I've made some minor changes to the species list. The column that displays the class, order and family to which a species belongs now renders the taxonomic groupings as hyperlinks, so it's now possible to immediately jump to all other species within that grouping. Secondly, the 'current list' text above ... Read more

Skip to content