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

  • Home
  • SEARCH
  • 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 8116673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:54:16+00:00 2026-06-06T03:54:16+00:00

This is working fine in Firefox and IE, but I can’t get this to

  • 0

This is working fine in Firefox and IE, but I can’t get this to work in Chrome:

self.editorIframeDocument.body.focus()

editorIframeDocument == contentDocument || contentWindow.document depending on the browser.

.body.focus() makes it so when the editor loads I can start typing right away. Perfect, however, in Chrome it’s not working. I tried hooking into the iframe as well as the iframe #document but no go.

I saw some hacks with setting a selection and removing it, but they were all examples in a <div> contenteditable with specific HTML inside not an <iframe> which could have anything from nothing to large amounts of text.

No jQuery.

  • 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-06-06T03:54:18+00:00Added an answer on June 6, 2026 at 3:54 am

    The problem was that the editor wasn’t loaded yet so Chrome wouldn’t let me focus on it. Checking for ready state fixed the issue:

    if (self.settings.focusOnLoad) {
      // We need to wait until all three iframes are done loading by waiting until the parent
      // iframe's ready state == complete, then we can focus on the contenteditable
      self.iframe.addEventListener('readystatechange', function () {
        if (self.iframe.readyState == 'complete') {
          self.editorIframeDocument.body.focus();
        }
      });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code, which is working fine in FireFox, chrome and IE8 but
This is working fine in firefox but only closes the first page and then
This seems to work fine in Firefox but, in IE8 specifically (it may work
I've been trying to get this working for the last hour, but I can't
Popup window is working fine in firefox and google chrome, but not working in
My CSS code below is working fine in Chrome, but isn't working in Firefox.
Why this javascript working fine in Firefox but not in IE 6 and 7
My site is working fine in Firefox, Safari, Chrome, and Opera, but for some
Hi Javascript gurus, I have this Javascript code which is working fine on Firefox
This is working fine in core php, but not in magento. $party_payment = new

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.