I am getting an
Uncaught SyntaxError: Unexpected token (
error on the following ajax code. The error is on this line:
function(resultArray) {
The code is:
$(document).ready(function() {
displaycars();
function displaycars () {
$.ajax({
type : 'GET',
url : '/modules/crm/selector-ajax.php',
data : {
'action' : 'get-images'
},
success : function(result) {
var selectorDiv = $('#car_isotope_gallery');
var resultArray = $.parseJSON(result);
console.log(result);
console.log(selectorDiv);
console.log(divHtml);
console.log(resultArray);
function(resultArray) {
var divHtml = '';
var i;
for (i = 0; i < arr.length; i++) {
divHtml += "<div class='element-item honda parts plans class'><h3 class='name'>" + resultArray[i].product_name + "</h3><p class='weight'><img src='" + resultArray[i].photo + "' width='80' border='0' alt=''></p></div>";
}
}
console.log(divHtml);
selectorDiv.html(divHtml);
},
error : function(err) {
console.log('ajax failure');
}
});
}
}); // end of document ready
I'm just not seeing the issue and have been hitting my head against the wall for way too long now. Any help is gratefully appreciated.