Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
explorer range problem
Old 07-18-2010, 04:50 AM explorer range problem
Junior Talker

Posts: 1
Name: peterpaul
Trades: 0
Hi at all

I have MSIE problem using seleection and text range

First I have an internet web site studing an old dialect language.

To write properly our dialect we must use special ACCENTED characters like üÜöôóòëêéè that are not into our keyboard .

To do that I modify the "FreeRichTextEditor" http://www.freerichtexteditor.com/ adding a lot of buttons

Clicking one of these buttons I call this function:

Code:
function insert_accented_char(str)//str parameter is the accented character that I want to insert
    {
if(document.selection){
cDoc = document.getElementById(rteName).contentWindow.document;
range=cDoc.selection.createRange();
range.text=str;
cDoc.selection.empty();
cDoc.focus();
} else if (window.getSelection) {

cWin = document.getElementById(rteName).contentWindow;
userSelection = cWin.getSelection();
userSelection=str;
cWin.document.execCommand('insertHTML',false,userSelection);
}
}
Character must be inserted at cursor position or they must replace a selection text selected by the user.

FireFox, opera and safari work properly but MSIE (8) replace best a selection range of text but if text is not selected it do not insert character at cursor position but it insert them into the calling button (that user clicked)

How can I solve problem?
You are more and more expert then me and I hope you'll help me in few minutes.

Best regards and thank you in advance.

Last edited by chrishirst; 07-18-2010 at 07:05 AM..
jomla is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to explorer range problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09035 seconds with 12 queries