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 6028199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:42:11+00:00 2026-05-23T04:42:11+00:00

I know this is crazy, but IE can drive one to do crazy things.

  • 0

I know this is crazy, but IE can drive one to do crazy things.

Here’s the deal: we have a SharePoint 2007 site with Content Editor Web Parts. We have a contingent of users with Internet Explorer 8. We want to keep the site in IE8/IE8 Standards modes for better rendering of content. However, this configuration breaks the ability to open the Rich Text Editor window from the C.E. web part.

If we force IE8 into IE7 document mode or quirks mode, it works. Indeed, other sources online have suggested doing just that to fix the problem. But we’d really rather have everything run in standards mode.

Through some debugging, we found the source of the problem to be the use of document.all.index("<web_part_id>") JavaScript when retrieving a web part object on the page. In IE8 standards, this returns an object with most of the properties either empty, null or undefined; most notably, the id property is not set. If you were to use document.getElementById to retrieve the same ID, you get back a fully populated object. Likewise if IE8 is not in standards mode, you get back a mostly (but not completely) populated object — but populated enough to avoid the script error, anyway.

All this code looks like it is injected dynamically into the SharePoint page, so that rules out simply replacing references to document.all. However, we got the crazy idea of redefining the document.all.item method to actually invoke document.getElementById. Our attempts so far to do this don’t work, so perhaps someone might shed some light on what we’re doing wrong (okay, there’s lots wrong about this, but it’s IE and SharePoint, right?).

Our initial attempt at an override looks like this:

<script type="text/javascript">
    document.all.item = function(id) { return document.getElementById(id); }
</script>

This code is in the document HEAD, above any other script references (SharePoint or otherwise), but it does not appear to supersede the native code.

Thoughts, ideas, suggestions and criticisms welcome!

  • 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-23T04:42:11+00:00Added an answer on May 23, 2026 at 4:42 am

    document.all is a HTMLCollection, so you may use HTMLCollection.prototype to change the behaviour:

    if(document.all 
       && !window.opera 
        && typeof HTMLDocument=='object' 
         && typeof HTMLCollection=='object')//filter IE8
    {
      HTMLCollection.prototype.item=
      function(id)
      {
       return((this==document.all)
               ? document.getElementById(id)//document.all
               : this[id]//maintain native behaviour for other collections
             ); 
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might sound super crazy but I really want to know if this can
Ok, this is driving me crazy. I have a CA that needs to know
I know this isn't strictly a programming question but y'all must have experienced this.
I know this is a stupid question, but I can't find the answer anywhere.
I know this may sound crazy, but I swear that on two separate ocassions
I know this seams a trivial question, but how can I disable the annoying
I'm always struggling with generics. I don't know why this makes my go crazy.
Know this might be rather basic, but I been trying to figure out how
I know this might be a no-brainer, but please read on. I also know
I know this is a broad question, but I've inherited several poor performers and

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.