This is a migrated thread and some comments may be shown as answers.

Problem with deleting <object> tags in FireFox

1 Answer 58 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jakub Sterba
Top achievements
Rank 1
Jakub Sterba asked on 30 Jul 2009, 09:40 AM
Hi,
I hit on issue with deleting <object> tags in FF.
When I insert some video or flash using Manager I get html code like that:

<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject" width="150" height="150"><param name="FileName" value="some_source"><embed src="some_source" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer" width="150" height="150"></object><br>

which is OK.
Problem occurs when I try to delete this object in FF in Design mode of RadEditor. It does not matter weather I try to delete the object by selecting it and hitting DEL or backspace. The result is that flash object disappears from design view but in HTML source is still some code left:

<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject" width="150" height="150"><param name="FileName" value="some_source"></object><br>

RadEditor only erases <embed> tag but lefts <object> in HTML code. When I open page with html code like this in it in IE I can still see the empty window of the mediaplayer.

Is there any way to easy fix this problem?

Best regards,
Jakub Sterba
Cyber Stream Technology

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Jul 2009, 01:34 PM
Hi Jakub,

Please, note that Firefox is unable to preview video and flash <object> elements in the editable IFRAME / DIV elements. To visualize the flash videos in this browser RadEditor is displaying an image over the hidden embed tag. You can see in the real-time html module in Design mode that the editor is replacing the embed tag with an img tag:

<img isflash="true" src="/mar26/WebResource.axd?d=VKgfCOMGbNfFHpaQ2fagQwx54iDXBFZvJ7fIi4SHX7kJQaESHnWBw0ciKR3EmQ4gyVj3mPF0yY8UbGwj-HF14xc1L6Up4UM7hu5wOZEGJyM1&amp;t=633761549161885913"  ...

So when the user clicks on this IMAGE (presenting the embed tag in design mode) and press delete or backspace then the <img> tag is deleted but the OBJECT tag remains, because this operation is controlled by the browser. You should switch to Html mode and manually delete the OBJECT tag or check for object tags that do not contain embed tags in them on submit and strip them.

You can attach to the OnClientSubmit event property of RadEditor and get a reference to the editor's document using the editor.get_document() method. You can search for object tags using editor.get_document().getElementsByTagName("object").

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Jakub Sterba
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or