|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Copy paste
hi,
i'm not really a javascript expert and i'm already at the and of my knowledge, so please could anyone help me? there's an editable div, sort of text editor, and there's a javascript for cleaning the pasted code. this runs when user hits Ctrl+V and it cleans the whole content of the div. can anyone help me how to clean only the last pasted part? thank you in advance regards Last edited by elhombre : November 15th, 2007 at 04:26 PM. |
|
#2
|
|||
|
|||
|
i got it, it works in MSIE.
i used the following: function copyPaste(theArea,e){ document.getElementById(theArea).focus(); document.getElementById(theArea).document.selectio n.createRange().pasteHTML(e); } function getClipbordData(tid){ if(event.ctrlKey && event.keyCode == 86){ var bResult = window.clipboardData; var text = window.clipboardData.getData("Text"); text = clearPaste(text); // this picks unnecessary things copyPaste(tid,text); return false; } } Quote:
|
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Copy paste |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|