You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#115770 Iframe with "data-src" attribute

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Arriba on Tuesday, 16 January 2024 11:21 GMT

Arriba
Hi!

On a webpage i coded a consent solution that don't loads YouTube-videos until consent is given. I write the url in the "data-src" attribute and when consent is given javascript copies it in the "src" attribute and the video is loaded.

It works fine. You can see it here for example: https://www.benott.de/blog/hotel-kaiserhof-gastgeber-aus-leidenschaft


Problem is when i swap from codeview to editor view in JCE Pro the iframe gets erased. Code is like this: <iframe data-src="https://www.youtube-nocookie.com/embed/TUsqL7oHzno" allowfullscreen="allowfullscreen" frameborder="0" height="315" width="560" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"></iframe>

I put iframe[data-src] to the extended elements and iframes are allowed in the media support. Clean up html is turned off.

Is there a solution for this problem?


Kind regards, Sascha

Ryan
Please try JCE Pro 2.9.59 Beta 5 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Arriba
Hi Matt, thx for your work! The iframe not gets erased anymore when i swap from code to editor view, but all the other attributes are erased. "data-src" is the only attribute that is not deleted after swapping.

Kind regards!

Ryan
I put iframe[data-src] to the extended elements

but all the other attributes are erased. "data-src" is the only attribute that is not deleted after swapping.


Please remove this addition as it is not neccessary and is causing the attribtues to be erased.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Arriba
Yes now it works. Thx!!