I have a JS function with ajax and I keep getting this error when loading the page:
JSON Parse error: Unexpected identifier "array"
I tried looking it up online and didn't see any with the array issue.
$("#imported-list-wrapper").html("");
$("#processing").show();
$("#data-for-analysis").hide();
var selectedCriteriaValues = new Array();
$.each(criteriaList,function(index,criteria) {
var item = {"Name" : criteria, "Value" : $("#search-" + criteria).val()};
selectedCriteriaValues.push(item);
});
dateList = new Array();
$.ajax({
url: "Resources/PHP/GetImportedData.php",
data: {
dataset: currentDatasetID,
conditions: selectedCriteriaValues,
},
success: function(response) {
$("#processing").hide();
// CHANGED
var data = JSON.parse(response);// ERROR HERE
importedData = data;
var items = "";
if (data.length > 0)