I am currently having a problem with my BB-code editor, like most things it works great in FF, but i have an issue with IE: whenever i select a word that has already been previously typed, it selects that word instead of the one i selected.
Here is the selection part of my editor:
if (window.getSelection){
selection = window.getSelection();
}else if (document.getSelection){
selection = document.getSelection();
}else if (document.selection){
selection = document.selection.createRange().text;
}
Example:
The text: the cats attack the other cats
I selected the second "cats", but the script keeps returning the first "cats"
Does anyone have a suggestion on how to fix this?