views:

1034

answers:

0

I'm using the jQuery plugin lwrte (http://code.google.com/p/lwrte/). I've implemented a custom drop down in the panel of the wysiwyg that, when select, outputs a value at the cursor position. This jQuery plugin uses an iFrame to accomplish the wysiwyg functionality.

The above works in IE and in FF, but is broken in Chrome and Safari. The closest I've come is appending selected value to the end of the iFrame's document.body.innerHTML field.

var container = $("[id$='wysiwyg']");
if (container.length == 0)
    return false;
else
    container = container[0];

var oDoc = container.contentWindow || container.contentDocument;
if (oDoc.document) {
    oDoc = oDoc.document;
}

oDoc.body.innerHTML += selectedTag.val();

All help is very much appreciated.