kartograph / kartograph.js

UNMAINTAINED Open source JavaScript renderer for Kartograph SVG maps
http://kartograph.org
GNU Lesser General Public License v3.0
1.51k stars 227 forks source link

Console error 'Unable to run script because scripts are blocked internally.' #65

Closed webbird closed 9 years ago

webbird commented 9 years ago

I am trying to load a choropleth map like so:

$.getJSON('countries.php', function(countries) {
    $.get('https://vumaasha.github.io/codehook/resources/kartograph/world.svg', function(svg) {
        var map   = kartograph.map('#mod_bcstats_worldmap', 640, 420);
        var color = chroma.scale('Blues').domain(countries, 7, 'quantiles', 'count');
        map.setMap(svg);
    });
});

As soon as I add the setMap() line, I get the error. The contents of the countries.json are very simple (as it's still only example data):

{"DE":{"year":"2015","iso":"DE","country":"Deutschland","count":"1","lastseen":"1428423817"},"MY":{"year":"2015","iso":"MY","country":"Malaysien","count":"1","lastseen":"1428425714"}}

Firebug tells me a correct content header for the json data, which was created using PHP json_encode(). Doing a console.log() for 'countries' shows expected results. I also tried a local SVG which didn't work, too.

I'm stuck.

webbird commented 9 years ago

Seems to be a Firefox issue. Got this working now. (Error message stays the same, but the map works.) Only problem is that Browcap gives 2-char ISO names while the world.svg uses 3-char names. Not a Kartograph problem. ;)