First I’m sorry for mistakes that I will write – I know English very bad but I hope you will understand my question.
I write a simple JavaScript code:
var userSelection;
if (window.getSelection) {
userSelection = window.getSelection();
alert(userSelection + ' Mozzila, Opera');
}
else if (document.selection) { // should come last; Opera!
userSelection = document.selection.createRange();
var selectedText = userSelection;
if (userSelection.text)
selectedText = userSelection.text;
alert(selectedText + ' IE');
}
but problem is that my selected text show only Internet Explorer, but Fire Fox and Opera don’t and I don’t understand why. Can someone help me?
I write a simple JavaScript code:
var userSelection;
if (window.getSelection) {
userSelection = window.getSelection();
alert(userSelection + ' Mozzila, Opera');
}
else if (document.selection) { // should come last; Opera!
userSelection = document.selection.createRange();
var selectedText = userSelection;
if (userSelection.text)
selectedText = userSelection.text;
alert(selectedText + ' IE');
}
but problem is that my selected text show only Internet Explorer, but Fire Fox and Opera don’t and I don’t understand why. Can someone help me?