views:

61

answers:

1

I am writing a plugin to an old IE-only WYSIWYG-editor which resides in an old CMS. I've created a plugin that opens an popup where the user can enter the url of an youtube clip.

The popup then creates the corrent <object..><param..> markup for the embed and uses Internet Explorers pasteHTML function;

var range = plugin.editorDocument.selection.createRange();
var embedHtml = OpenDialog(dialogUrl, null, 400, 200);

if (!embedHtml) {
    return;
}
range.pasteHTML(embedHtml);

I know it's missing a bit of information about some of the variables but you get the picture. The problem is that the <param>-tags gets removed when i run the pasteHTML. I wonder if anyone have an idea of fixing this, and letting me keep my param-tags

A: 

I'd suggest putting an ID on the <object> element, getting hold of it after the pasteHTML call via document.getElementById and using document.createElement and the object element's appendChild method to create and add <param> elements.

Tim Down
Did this work for you?
Tim Down