Search code examples
javascripthtmlcssinternet-explorer-8jvectormap

Jvector Map Not Working prepare IE8?


I have currently Using Jvcetor Map showing error in IE8 browser.document mode and browser Mode different showing errot. but both same its working Here attach MY code :

 <!DOCTYPE html>
    <html>
    <head>
      <title>Country Footprint</title>
      <script>
        jQuery.noConflict();
        jQuery(function(){
          var $ = jQuery;
          $('#focus-single').click(function(){
            $('#map1').vectorMap('set', 'focus', {region: 'AU', animate: true});
          });
          $('#focus-multiple').click(function(){
            $('#map1').vectorMap('set', 'focus', {regions: ['AU', 'JP'], animate: true});
          });
          $('#focus-coords').click(function(){
            $('#map1').vectorMap('set', 'focus', {scale: 7, lat: 35, lng: 33, animate: true});
          });
          $('#focus-init').click(function(){
            $('#map1').vectorMap('set', 'focus', {scale: 1, x: 0.5, y: 0.5, animate: true});
          });
          $('#map1').vectorMap({
            map: 'world_mill_en',
            panOnDrag: true,
            focusOn: {
              x: 0.5,
              y: 0.5,
              scale: 1,
              animate: true
            },
            series: {
              regions: [{
                scale: ['#688FA0'],
                normalizeFunction: 'polynomial',
                values: {





      </script>

its showing web page error In IE8. how to run when document mode and browser different ? please help me


Solution

  • This is like the fifth time you're asking the exact same question?

    I've answered it in the comments, and you keep asking the same thing, with the same code, here

    https://stackoverflow.com/questions/30475659/jvector-map-not-working-correctly-ie-8#comment49031731_30475659

    and here, different user, but exact same code

    Jvector Map not working when browser Mode and document mode different in IE8

    Try to listen this time, you have a trailing comma inside the object that defines the options for jVectorMap

    $('#map1').vectorMap({
        map: 'world_mill_en',
        panOnDrag: true,
        focusOn: {
            x: 0.5,
            y: 0.5,
            scale: 1,
            animate: true
        },
        series: {
            regions: [{
                scale: ['#688FA0'],
                normalizeFunction: 'polynomial',
                values: {
                  "TL": 0.62,
                  "TO": 0.3,
                  "GB": 2258.57,
                  "US": 14624.18,
                  "VU": 0.72,  // IT'S HERE ----------------
                }
              }]
            },
    

    Note the trailing comma, the last property in an object shouldn't have a trailing comma as there are no more properties following it.

    Most browsers don't care, but in old IE you'll get the exact same error you're getting, and you have to remove the last comma.