I try to backup a TextRange object in JavaScript to restore it later, so to do this i've tried to link a function to the blur event but when the function is called my selection is already lost :/ How can i run specific behaviour BEFORE the blur event ? Or have you an other solution to do this trick ?
I've tried this :
this._editableFrame._elt.onload= function(oEvent){
oEvent.srcElement.contentDocument.body.onblur=function(oEvent) {
this._sel=this.document.selection.createRange().duplicate(); }
/*alert(this._sel.text);*/
return true;
};
And when i do this i just have an empty TextRange :/ but if i write an "alert" in the function i succeed to get my text selection in the blur function :/ How can i capture the blur event and what can i do with this type of manipulations ? I'm a beginner in javascript.
Thanks a lot, i spent a lot of time on this problem... :/