Hi there,
I am workging on implementing a forced Word clean up when a user pastes in the web browser. The code registers an onPaste event handler, grabs the clipboard content, runs it through CleanWord(), and then inserts the cleaned HTML (overriding what would normally be pasted).
This appears to be working okay in IE, however I am having problems with Firefox. the onPasteHandler (see below), is fired fine in both browsers, but in Firefox GetClipboardHTML() returns an empty string, and the pasted content gets inserted wholesale. Any ideas of what I am doing wrong here?
Thanks,
Michael
function onPasteHandler(editorInstance)
{
var A = editorInstance.GetClipboardHTML();
A = CleanWord(A);
editorInstance.InsertHtml(A) ;
return false;
}
function FCKeditor_OnComplete(editorInstance)
{
editorInstance.Events.AttachEvent('OnPaste', onPasteHandler);
}
I am workging on implementing a forced Word clean up when a user pastes in the web browser. The code registers an onPaste event handler, grabs the clipboard content, runs it through CleanWord(), and then inserts the cleaned HTML (overriding what would normally be pasted).
This appears to be working okay in IE, however I am having problems with Firefox. the onPasteHandler (see below), is fired fine in both browsers, but in Firefox GetClipboardHTML() returns an empty string, and the pasted content gets inserted wholesale. Any ideas of what I am doing wrong here?
Thanks,
Michael
function onPasteHandler(editorInstance)
{
var A = editorInstance.GetClipboardHTML();
A = CleanWord(A);
editorInstance.InsertHtml(A) ;
return false;
}
function FCKeditor_OnComplete(editorInstance)
{
editorInstance.Events.AttachEvent('OnPaste', onPasteHandler);
}
RE: onPaste handling problems