Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

data-url attribute not behaving properly

more options

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.

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 by ybce

All Replies (2)

more options

I'm using the latest version of Firefox and tested it on older versions.

Modified by ybce

more options

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).