
data-url attribute not behaving properly
Hello,
I have an on-demand player on a website with a data-url that points to a url that displays a player on the website which users can listen to radio shows from.
Example URL: https://chuo.fm/show/this-is-heart-city/ If someone clicks on the play button towards the bottom of the page in Chrome and Edge, the player pops up under the links and plays. However, a listener complained that this isn't happening in Firefox. Firefox opens up a new tab with the same exact url, I know this is due to target="_blank" and href="#" but even after removing them, nothing happens.
Feel free to inspect the code and let me know what can be done to fix the issue.
Thanks.
Modified
All Replies (2)
I'm using the latest version of Firefox and tested it on older versions.
Modified
To cancel link navigation causing the new page, you should "return false" from your click event handler.
If I use the Page Inspector and add this attribute (plain JS, not jQuery, since that doesn't seem to work inline), the page does populate into the frame:
onclick="document.getElementById('frame').setAttribute('src', this.getAttribute('data-url')); return false;"
You may want to clean up the mixed content issues (check the Web Console for messages).