Is there a standard cross-browser HTML5 event which corresponds to IE legacy onselectionchange (so it is fired when the current selection changes)?
EDITED, I’m looking to track Selection object changes.
Advertisement
Answer
use onchange
I recommend using jQuery to avoid these cross browser issues, but that does not mean you should skip testing. see here.
Look at Rangy window.getSelection = rangy.getSelection
it might work…
JavaScript
x
12
12
1
/*
2
IE 8 getSelection() missing object and properties simple hack
3
*/
4
if (window.getSelection == undefined) { /* IE? */
5
var wgS = setInterval(function(){ /* wait for Rangy */
6
if (rangy.initialized) {
7
window.getSelection = rangy.getSelection; /* do the stuff */
8
clearTimeout(wgS); /* exit */
9
}
10
}, 10);
11
}
12
Source : Web