Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 408751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:43:20+00:00 2026-05-12T17:43:20+00:00

I’ve searching forever trying to figure out why IE will not save the current

  • 0

I’ve searching forever trying to figure out why IE will not save the current caret position and then reload it. To be descriptive of the situation it works like this:

Client wants Tinymce custom built with an ajax image loader that is simplistic in the nature that any “idiot” can upload and set some settings to an image within the text editor and make it look nice. We have a lot of clients that like to just paste from word and fckeditor just wasn’t cutting it any more. At any rate the ajax/the uploader all that works flawlessly. The problem becomes when entering the image into the editor. FF/Opera/Crome etc, work flawlessly, but IE of course has the problem.

Here’s what I need an answer to, the Tinymce loses focus because a jQuery dialog box pops up for the uploading (this feature can not be developed as a plugin, they want external tools, so no tinyMCEPopUp classes/functions will work so I can’t simply call tinyMCEPopup.restore()) I need to save the caret position/selection of the image and store it/pass it through some functions and when placing it restore the selection.

I’ve tried doing it hundreds of ways and only one has worked as getting the correct selection length but still cursor is at pos 0. this has worked when creating a range object in IE

if(document.selection) {
b = document.getElementById('txtarea'); 
range = b.createTextRange();
//the rest of the jaz
}

I’ve been told by many sources that getting it from the DOM won’t work because Tinymce is built inside an iframe, but createRange() is also not storing currently. If anyone knows of or has found a work around for this I’d greatly appreciate it, I’ve been racking my brain for 16hrs of development time trying to work this out with no useable solution. using tinyMCE.activeEditor.selection.getBookmark() is also having no dice. I’m average at Javascript, I know my way around but it is defiantly not my strong point, PHP/backend/software development is. So it may just be me being stupid when there is a simple solution.

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:43:21+00:00Added an answer on May 12, 2026 at 5:43 pm

    I still think TinyMCE will do this for you but I’m not an expert on it and haven’t got time to play with it right now (maybe later). I know about selections and Ranges though, so you may be able to adapt the functions below for your purpose. You’ll need to pass in the window object for the editor iframe into both functions:

        function saveSelection(win) {
         var doc = win.document;
         var sel = win.getSelection ? win.getSelection() : doc.selection;
         var range;
    
         if (sel) {
          if (sel.createRange) {
           range = sel.createRange();
          } else if (sel.getRangeAt) {
           range = sel.getRangeAt(0);
          } else if (sel.anchorNode && sel.focusNode && doc.createRange) {
           // Older WebKit browsers
           range = doc.createRange();
           range.setStart(sel.anchorNode, sel.anchorOffset);
           range.setEnd(sel.focusNode, sel.focusOffset);
    
           // Handle the case when the selection was selected backwards (from the end to the start in the
           // document)
           if (range.collapsed !== sel.isCollapsed) {
            range.setStart(sel.focusNode, sel.focusOffset);
            range.setEnd(sel.anchorNode, sel.anchorOffset);
           }
          }
         }
         return range;
        }
    
        function restoreSelection(win, range) {
         var doc = win.document;
         var sel = win.getSelection ? win.getSelection() : doc.selection;
    
         if (sel && range) {
          if (range.select) {
           range.select();
          } else if (sel.removeAllRanges && sel.addRange) {
           sel.removeAllRanges();
           sel.addRange(range);
          }
         }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.