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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:50:28+00:00 2026-05-25T23:50:28+00:00

I don’t understand this at all. Here is some Javascript code that works in

  • 0

I don’t understand this at all. Here is some Javascript code that works in every browser but IE 9. It is called from a Flash movie using ExternalInterface, and is meant to dynamically resize the movie in the DOM if the size of the movie changes internally

function vResizeFlash(swfId, ht) {
    document.getElementById(swfId).height = "100%";
    document.getElementById('flashContainer').style.height = ht + "px";
}

But it works fine if I alter the document.title:

function vResizeFlash(swfId, ht) {
    // IE 9 won't run the rest of this function unless
    // we go through the charade of changing the document title.
    if (navigator.appName.indexOf("Microsoft") != -1) {
       var docTitle = document.title.replace(/^(.+?)\s*$/,"$1");
       document.title = docTitle + " ";
    }
    // Well-coded browsers begin here
    document.getElementById(swfId).height = "100%";
    document.getElementById('flashContainer').style.height = ht + "px";
}

Here I simply trim any white-space from the right side of the document.title, then add a single white-space character to it. Suddenly the following lines get executed. Note: there are other ExternalInterface calls on the page, and all of them work fine, even in IE 9, so it’s not a Flash/IE 9 problem.

I stumbled on the fix because I was altering the title to show the function arguments (as a quick debugging test), just to make sure the function was getting run. And suddenly the code worked. Take it out? Doesn’t work. 100% reproducible.

Anybody know why this absolutely stupefying behavior takes place?

UPDATE

@c69 has posed the question: “Maybe its IE9’s dead code remover?”

I didn’t know about this, so I went and Googled and found this article on the topic, as well as some discussion of it elsewhere. I don’t know enough about it to evaluate how this would affect a two-line Javascript function, however, especially since one of the lines does have a referent on the page (although it is late-loading through the SwfObject code). Still, it would be a pretty bad bug for a code “optimizer” to remove lines of code it deemed unnecessary because it doesn’t understand how they are called. And if it did fail to understand how the lines are called, how does inserting a line making a bogus change to the document.title render that code suddenly “necessary”?

UPDATE 2

Another piece of the puzzle This may have something to do with IE 9’s compatibility mode. The page starts out in IE 9’s standards mode.

enter image description here

Now, if I turn on IE’s compatibility mode,

enter image description here

the problem goes away without using the above hack. Turn it off, and the problem returns (if no hack present).

But when I tried to make a simple test using the exact same HTML (minus a couple of JSP tags) and a stripped down SWF that only contains the resize code and the tools to test, everything works fine. In that case, however, no compatibility icon is displayed at all.

enter image description here

We’re using Tomcat 6.0.32. I’m not aware that we are using any special headers, and there are no meta tags regarding IE compatibility mode (in either the main app or in my test app).

  • 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-25T23:50:29+00:00Added an answer on May 25, 2026 at 11:50 pm

    like InvertedSpear mentions, check your doc type out, i’ve had problems with IE9 recently and most of it boiled down to the Doc type tags triggering a compatability mode i didn’t need, the same can be true of the meta tags so it might boil down to your Meta tags.

    You can always impose a working compatibility mode using the links below too.

    from: http://evolpin.wordpress.com/2011/02/25/ie9-compatibility-and-the-meta-tag/

    I’ve discovered that this is indeed documented by Microsoft…

    http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

    “The X-UA-Compatible header is not case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't think that I'm mad, I understand how php works! That being said. I
I don't understand why this code doesn't work: function Messages(type,text) { console.log(In function Message);
I don't understand where the extra bits are coming from in this article about
Don't need to do this right now but thinking about the future... What would
Don't they both have to convert to machine code at some point to execute
Don't know if this is the right place to ask this, but I will
Don't know if there is a better way to do this, so that is
Don't know if this is an eclipse specific problem but whenever I declare a
DON'T ASK WHY but... I have a regex that needs to be case insensitive
don't understand: in my controller: @json = User.all.to_gmaps4rails do |user| \Title\: \#{user.email}\ end in

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.