Javascript语法错误 [英] Javascript syntax error

查看:72
本文介绍了Javascript语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好 - 我在Highmaps上使用Javascripts并收到错误:Uncaught SyntaxError:以下代码上的意外令牌va。有人可以指出我哪里出错吗?



 $(function(){


$ .getJSON('http://127.0.0.1:8887/Census2011_ReprojectedWithJoin_v2.geojson',function(geojson)
//准备随机数据
var data = [geojson.features。 '2011人口'] {

//启动图表
Highcharts.mapChart('container',{
debugger;
title:{
text :'Highmaps中的GeoJSON'
},

mapNavigation:{
enabled:true,
buttonOptions:{
verticalAlign:'bottom'
}
},

colorAxis:{
},
调试器;
系列:[{
数据:数据,
mapData:geojson,
名称:'随机数据',
状态:{
悬停:{
颜色:'#BADA55'
}
},
dataLabels:{
enabled:true,
format:'{point.properties .postal}'
}
}]
});
});
});





我尝试过:



调试,计算括号数 - 我看不出有什么问题

解决方案

(function() {


.getJSON('http://127.0.0.1:8887/Census2011_ReprojectedWithJoin_v2.geojson',function(geojson)
//准备随机数据
var data = [geojson.features.'2011 Population'] {

//启动图表
Highcharts.mapChart('container',{
debugger;
title: {
text:'Highmaps中的GeoJSON'
},

mapNavigation:{
enabled:true,
buttonOptions:{
verticalAlign: '底部'
}
},

colorAxis:{
},
调试器;
系列:[{
数据:
mapData:geojson,
名称:'随机数据',
状态:{
hover:{
颜色:'#BADA55'
}
},
dataLabels:{
enabled:true,
format:'{point.properties.postal}'
}
}]
});
});
});





我尝试过:



调试,计算括号数量 - 我看不出有什么问题


这里:

 var data = [geojson.features.'2011 Population'] {



下次复制样本时,请正确执行,并使用合适的JavaScript编辑...


Hi there - I am using Javascripts on Highmaps and am getting the error: Uncaught SyntaxError: Unexpected token va on the following code. Can someone please point out where I am going wrong?

$(function () {


  $.getJSON('http://127.0.0.1:8887/Census2011_ReprojectedWithJoin_v2.geojson', function (geojson)
  // Prepare random data
    var data = [geojson.features.'2011 Population'] {

        // Initiate the chart
        Highcharts.mapChart('container', {
debugger;
            title: {
                text: 'GeoJSON in Highmaps'
            },

            mapNavigation: {
                enabled: true,
                buttonOptions: {
                    verticalAlign: 'bottom'
                }
            },

            colorAxis: {
            },
debugger;
            series: [{
                data: data,
                mapData: geojson,
                name: 'Random data',
                states: {
                    hover: {
                        color: '#BADA55'
                    }
                },
                dataLabels: {
                    enabled: true,
                    format: '{point.properties.postal}'
                }
            }]
        });
    });
 });



What I have tried:

debugging, counting the number of brackets - I cannot see what is wrong

解决方案

(function () {


.getJSON('http://127.0.0.1:8887/Census2011_ReprojectedWithJoin_v2.geojson', function (geojson) // Prepare random data var data = [geojson.features.'2011 Population'] { // Initiate the chart Highcharts.mapChart('container', { debugger; title: { text: 'GeoJSON in Highmaps' }, mapNavigation: { enabled: true, buttonOptions: { verticalAlign: 'bottom' } }, colorAxis: { }, debugger; series: [{ data: data, mapData: geojson, name: 'Random data', states: { hover: { color: '#BADA55' } }, dataLabels: { enabled: true, format: '{point.properties.postal}' } }] }); }); });



What I have tried:

debugging, counting the number of brackets - I cannot see what is wrong


Here:

var data = [geojson.features.'2011 Population'] {


Next time you copy a sample do it properly, and use a decent JavaScript editor...


这篇关于Javascript语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆