We use the Cute wysiwyg on our site, and we've suddenly sprouted a problem with how its Paste function works when called one way but not another. Below is how they do paste. Basically, they add a little marker to what you want to paste, call pasteHTML(),
then verify things worked by snipping out their marker. It's the last bit that's blowing up now in some circumstances.
// Javascript/comment in the beginning of the HTML will be preserved.
val = '<span id="__temp_span__" style="display:none;">temp_span</span>' + val ;
var r=editdoc.selection.createRange();
r.select();
editdoc.parentWindow.focus();
r.pasteHTML(val);
editdoc.getElementById("__temp_span__").removeNode(true); // BOOOM!
My problem is that I have yet to identify what the circumstance is that's causing the failure.
I've looked to see what editdoc.parentWindow.document.activeElement is when it's working and when it's not, and in both cases it appears to be the <BODY> element of the iframe is working in.
Is there any way to figure out why pasteHTML() chooses not to actually paste something?
Member
2 Points
65 Posts
textRange.pasteHTML() quietly not doing anything; how to diagnose?
May 23, 2011 04:11 PM|mmodrall|LINK
Hi...
We use the Cute wysiwyg on our site, and we've suddenly sprouted a problem with how its Paste function works when called one way but not another. Below is how they do paste. Basically, they add a little marker to what you want to paste, call pasteHTML(), then verify things worked by snipping out their marker. It's the last bit that's blowing up now in some circumstances.
// Javascript/comment in the beginning of the HTML will be preserved.
val = '<span id="__temp_span__" style="display:none;">temp_span</span>' + val ;
var r=editdoc.selection.createRange();
r.select();
editdoc.parentWindow.focus();
r.pasteHTML(val);
editdoc.getElementById("__temp_span__").removeNode(true); // BOOOM!
My problem is that I have yet to identify what the circumstance is that's causing the failure.
I've looked to see what editdoc.parentWindow.document.activeElement is when it's working and when it's not, and in both cases it appears to be the <BODY> element of the iframe is working in.
Is there any way to figure out why pasteHTML() chooses not to actually paste something?
thanks
Mark
Contributor
2808 Points
1815 Posts
Re: textRange.pasteHTML() quietly not doing anything; how to diagnose?
Jun 10, 2011 07:57 AM|jeyaseelan@ajsquare.net|LINK
hi ,
try this way http://forums.asp.net/t/1125227.aspx/1?disable+COPY+Paste+function+on+a+textbox
J.Jeyaseelan