How to fix the following error: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data?
<p>I'm trying to get some data on my map with a AJAX call. But I get the following error: <code>SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data</code>. I did <code>console.log(dataArray)</code>. The thing is that two datasets I implemented in my application before did work and appear on screen but when I tryed to implement my third dataset I got this error and the var <code>dataArray</code> stays empty.</p>

<pre><code>geojson_popupInfo = {
    "type": "FeatureCollection",
    "features": [],
};

geojson_dataTable = {
    "type": "FeatureCollection",
    "features": [],
};

var dataArray = data.split(", ;");
dataArray.pop();

dataArray.forEach(function(d){
d = d.split(", "); 

var feature_popupInfo = {
    "type": "Feature",
    "properties": {}, 
    "geometry": JSON.parse(d[fieldList.length]) 
};

var feature_dataTable = {
    "type": "Feature",
    "properties": {}, 
    "geometry": JSON.parse(d[fieldList.length]) 
};

for (var i=0; i&lt;fieldList.length; i++){
    if ([fieldList[i].show_field] == 't') {
        feature_popupInfo.properties[fieldList[i].field_alias] = d[i];
    }
    feature_dataTable.properties[fieldList[i].field_name] = d[i]; 
};
geojson_popupInfo.features.push(feature_popupInfo);
geojson_dataTable.features.push(feature_dataTable);
});
console.log(dataArray)
</code></pre>