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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:04:14+00:00 2026-06-11T16:04:14+00:00

javascript code shows error in Internet Explorer but not in FF. $(document).ready(function(){ var countries

  • 0

javascript code shows error in Internet Explorer but not in FF.

$(document).ready(function(){




var countries = [
  ["Afghanistan","Af"],
  ["Åland Islands","Ax"],
  ["Zimbabwe","Zw"]
];

 var countryNames = countries.map(function(country){
  return {
    /*label: '<div class="flag '+country[1].toLowerCase()+'">'+country[0]+'</div>',*/
    value: country[0]
  }

  var my_var=countryNames();
}); 

});

In IE 8 developer tool, if I debug js, the error message is :’ Object doesn’t support this property or method’. And the error is indicated at the snippet starting with the line :

var countryNames = countries.map(function(country){

How to make the code work in IE ?

  • 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-11T16:04:16+00:00Added an answer on June 11, 2026 at 4:04 pm

    The Array.prototype.map() function is only supported in Internet Explorer 9, so that code won’t work in earlier versions of the browser. Since you’ve tagged the question as jQuery, you could use the jQuery.map() function instead:

    var countryNames = jQuery.map(countries, function(country) {
        return { 
            value: country[0]
        }
    });
    

    jsFiddle DEMO tested using Internet Explorer 9 in IE7 mode.

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

Sidebar

Related Questions

My JavaScript code is as follows: $(document).keydown(function(event){ var move, inter; clearInterval(inter); inter = setInterval(move
I have some JavaScript code that is supposed to run on document.ready but I
javascript code: function getCheckbox(name,id){ var check = 0; var deger = option-checkbox-+id; var dom
Javascript Code YAHOO.util.Event.onDOMReady(function (ev) { var carousel = new YAHOO.widget.Carousel(container, {isCircular: true, numVisible:1}); console.log(carousel.set('navigation',
I am currently facing an error in JavaScript. The code is given below function
This error is only present in Internet explorer but works in Mozilla so far.
When I run my code below then it shows error object is not a
I have the following javascript code var myDiv = document.getElementById(myDiv); alert(myDiv); myDiv.style.display = 'none';
I am getting this error when running a webpage in internet explorer 8 (not
This link shows how to inject JavaScript code to WebView object in Android. However

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.