Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4669025y@Fast-Nop but... "ID" doesn't have to be unique right? It's just a name we give it... right?
😔
I'm going to be hit for that... -
hitko31455yCompilers & certain libraries definitely have small differences across platforms, and there's also a chance package manager installed a different version of certain library than the one shipped with Windows installer.
More likely however is that the Linux dev was only testing with one product and it worked since there's been only one button with that ID, they only clicked the first button which worked while others didn't, or some other similar thing. -
This is why I'm afraid to use IDs in my html. They assume a single instance or shadow dom. (Which we scarcely use, for compatibility reasons).
-
@Lor-inc Not much of an issue actually. Either it's about stuff where there is only one instance supposed to be there, e.g. main navigation, or it's at least unique within its container and use e.g. chained ID naming (poor man's namespacing).
It's even vital if you have at least two instances of the same object with different state behind. The common stuff goes into the class which would be identical, but the specific actions need the ID. -
@Fast-Nop I meant that I always instinctively use classes, except for very high level components that are almost certainly singular in the document. (I.e. header, main layout. Not even main nav)
-
@Lor-inc For the header, you don't need any ID - the header tag is already there, after all.
Related Rants
We had a issue with a webstore that was only affecting users on Windows: one button didn't do anything.
The colleague that was working on the ticket was running Arch, and for him it was working as expected. He reported that the bug couldn't be replicated on Chromium, Firefox or qutebrowser. But our designer, who was running Windows 10, commented that it wasn't working for her in either Chrome or Firefox.
Some more conflicting reports later a colleague using Windows managed to fix it. It was caused by querying the button elements by id selector instead or a class selector. There was multple buttons, one for each product row.
I guess there just are platform differences that aren't specific to browser but instead the OS, that could have caused it
rant
bug