Dave
Dave

Reputation: 359

Cannot add Youtube iframe tag

I'm using the TinyMce and I want to add another button with 'Youtube add' functionality. The problem is with adding the iframe using 'mceInsertContent':

h = '<iframe class="video" src="' + f.width.value + '" frameborder="0"></iframe>';
tinyMCEPopup.execCommand("mceInsertContent", false, h);

Do you have any idea how to solve it? It doesn't want to render either in the editor or on the final page.

Upvotes: 1

Views: 197

Answers (1)

Sampson
Sampson

Reputation: 268326

For security reasons, iframe is not a valid tag that can be submitted through TinyMCE. You can, however, extend your current list of valid elements to include this tag if you are sure it will not be abused.

See the extended_valid_elements property during your call to init().

Upvotes: 1

Related Questions