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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:39:32+00:00 2026-06-08T18:39:32+00:00

In IE 8, the second version of this causes the following error: Object doesn’t

  • 0

In IE 8, the second version of this causes the following error:

Object doesn’t support this property or method.

The error is at map = new L.Map. In the first version, there are no errors.

I thought if you don’t include var it automatically goes to global scope. Why would an error occur in IE 8? Note, this doesn’t happen in IE 9.

var map;
jQuery(document).ready(function() 
{
    map = new L.Map('map', {'scrollWheelZoom': false});
 ...
}

VS:

jQuery(document).ready(function() 
{
    map = new L.Map('map', {'scrollWheelZoom': false});
 ...
}
  • 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-08T18:39:33+00:00Added an answer on June 8, 2026 at 6:39 pm

    I thought if you don’t include var it automatically goes to global scope.

    This is incredibly bad practice because there is no way to tell whether you intended that. It also causes an error in strict mode.

    It also causes bugs in IE when you have some element with the name map on the document.

    You can explicitly create a global like this:

    jQuery(document).ready(function() {
        window.map = new L.Map('map', {
            'scrollWheelZoom': false
        });
    });
    

    Here you make your intent clear and won’t get this error.


    Here are the jsfiddles to demonstrate it (Run in IE8 or lower):

    http://jsfiddle.net/3Jn5N/ works

    http://jsfiddle.net/3Jn5N/1/ doesn’t work

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

Sidebar

Related Questions

I'm want to display different image version: first article: big banner second: small banner
I am currently in charge of the development of the second version of program
//obj C version, with some - less than one second on 18,000 iterations for
I have a second .nib file that is a localized version of the main
the second function gives error C2803 http://msdn.microsoft.com/en-us/library/zy7kx46x%28VS.80%29.aspx : 'operator ,' must have at least
I have installed maven 2.2.1 on my debian machine and getting the following error
Let's say I have following Spring config (version of Spring is 3.0.3): <?xml version=1.0
I was trying to make a tail-recursive version of this very simple SML function:
I need help with my jcrop preview. I am following this tutorial from railscasts
I'm using the new Resharper version 6. In several places in my code it

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.