JavaScript buttons not working

Support and discussions for the x86/x64 Linux version of Pale Moon.

Moderator: trava90

Post Reply
User avatar
derekn
New to the forum
New to the forum
Posts: 2
Joined: 2020-01-03, 19:09

JavaScript buttons not working

Post by derekn » 2020-01-03, 19:27

I've been seeing occasional problems where JavaScript buttons (not sure how else to describe them) don't work in Palemoon. Here are two examples:

https://pomiferous.com/ -- clicking on any of the "Learn more..." buttons should open a new page.

https://darntough.com/products/micro-cr ... 4540746771 -- clicking on any of the color options should show that color in the large photo.

I'm running PaleMoon 28.8.0 on Linux. I've tried disabling all of my ad-blocking add-ons/proxy, and I've also tried safe mode; I'm still seeing the same behavior. Both sites work correctly in Firefox on Linux.

I'm interested to know if others can reproduce this.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 26676
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: JavaScript buttons not working

Post by Moonchild » 2020-01-03, 22:39

This has nothing to do with JavaScript.

The problem is that web designers don't seem to understand that anything you put inside a <button> element is display content only. Putting an anchor in there (hyperlink) will create a non-functional link because the active element for clicking is the button, not the anchor. If they want the html5 button to work as a button, then they need to link the URL to navigate to to the button element.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

User avatar
derekn
New to the forum
New to the forum
Posts: 2
Joined: 2020-01-03, 19:09

Re: JavaScript buttons not working

Post by derekn » 2020-01-03, 23:04

Thanks for taking a look at it. I had only taken a quick glance at the HTML, and just assumed (incorrectly) that there was some JavaScript magic happening.

Looks like the second one (darntough.com) actually has an <input> inside the <button>, which I guess is the same case as <a> inside <button>.

I hope this doesn't become a bigger problem. Both firefox and chromium allow the link/input inside the button. The online HTML5 validator generates a long list of errors, including the invalid nesting inside <button>, but I'm guessing no one bothers with that kind of validation.

Anyway, thanks for checking this out.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 26676
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: JavaScript buttons not working

Post by Moonchild » 2020-01-03, 23:10

Yeah it's the problem with "it works in Chrome" reasoning instead of "it's following standards". And Firefox aping Chrome behavior where possible and not giving any resistance to such bad design is not helping. What you can do to help is contact the webmasters and explain the issue and that it doesn't work in some browsers that don't use this quirk. They are the only ones that can solve the root of this problem.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

Post Reply