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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:59:35+00:00 2026-05-24T07:59:35+00:00

I found these lines in some code I was maintaining, which was failing in

  • 0

I found these lines in some code I was maintaining, which was failing in ie 7 and 8. Stepping through the constructor, I could see that all the code was executing properly. However, when the constructor returned, I got an “Object does not support this property or method” error. WTF?

One important thing to note is that the variable embedDialog has global scope (I know globals are evil, but I didn’t write this code).

// Results in "Object does not support this property or method in ie8 and ie7
embedDialog = new Dialog({
    id: "embedDialog",
    width: 400,
    height: 400,
    message: "Check it out",
    title: 'Cool dialog box'
});

If I give embedDialog functional scope, then voila it works:

// Eliminate global scope and it works
var embedDialog = new Dialog({
    id: "embedDialog",
    width: 400,
    height: 400,
    message: "Check it out",
    title: 'Cool dialog box'
});

The other way to fix it is to change the value of the id property to something other than the name of the variable, like so:

// Change "embedDialog" to "embedDialogBox" and voila it works
embedDialog = new Dialog({
    id: "embedDialogBox",
    width: 400,
    height: 400,
    message: "Check it out",
    title: 'Cool dialog box'
});

What the hell is wrong with IE? Can anyone explain why the original code breaks IE 7/8?

  • 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-24T07:59:35+00:00Added an answer on May 24, 2026 at 7:59 am

    If the “Dialog()” constructor function makes a DOM element with that “id” value (same as the global variable), then IE makes a global symbol with that name (colliding with your variable, obviously) and makes it refer to the DOM element. Your code probably expects it to be a “Dialog” instance.

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

Sidebar

Related Questions

I was reading some code found on the web and fell on these lines
I have a .NET 3.5 (target framework) web application. I have some code that
We’ve found that the unit tests we’ve written for our C#/C++ code have really
I want to change these lines in my excel VBA code to something much
I've inherited some code that has directory names with embedded spaces, and I don't
I have some HTML code which displays 9 images with fancybox styles. I duplicated
I found these questions, but a couple of them were a little old: https://stackoverflow.com/questions/191556/should-i-pursue-asp-net-webforms-or-asp-net-mvc
On the iReport documentation I found these XPath queries: /addressbook/category@name /addressbook/category/person@id /addressbook/category/person+LASTNAME /addressbook/category/person+FIRSTNAME /addressbook/category/person+hobbies*hobby
What is the best implementation of Markdown for C or C++? I found these
While editing an aspx file I found both these opening tags used for seemingly

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.