开发者

custom tag ckeditor error

开发者 https://www.devze.com 2023-03-01 09:37 出处:网络
Just started using ckeditor and got a little problem. On a button click outside the editor a开发者_开发百科 tag is generated and then inserted into the ckeditor using the following code:

Just started using ckeditor and got a little problem. On a button click outside the editor a开发者_开发百科 tag is generated and then inserted into the ckeditor using the following code:

CKEDITOR.instances['pageContent'].insertHtml('<cke:video id="video-' + i + '" class="video" src="' + $(this).siblings('.mediaName').text() + '">Video</cke:video>');

The above works fine. The tag is inserted into the editor and it shows the text "Video" in the wysiwyg view. When you click source it shows the tag code as shown below.

<video class="video" id="video-29" src="/link/to/file.flv">Video</video>

So all is well. However when i click back on wysiwyg view the "video" text placeholder thing is not there (yet the code is still in the source view.)

Then when you start to click around in the editor adding more content the console throws the error:

Permission denied to access property 'nodeType'

I have no idea why it is doing this but this only happens when i add the custom video tag into the mix. When googling im not finding anything substantial either :(

Really hope someone can help. i have absolutely no idea why it is doing this.

thanks for reading


Okay im not sure but i think this is a bug. I dont think ckeditor knows how to interpret the <video> tag.

My work around was to insert an image with all the video details in it and then do a replacement client side changing the <img> tag to <video>.

Its not ideal but it works :)

Hope this helps anyone else who happens to come across the same issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号