function showConfirm(reArray) {
var theHTML = '';
var optionArray = ["Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7"];
var myButtons = {};
var j = 1;
for(var i = 0; i < reArray.length; i++){
theHTML +='<div style="text-align:center">'
+ '<span>'+j+'.</span> '
+ '<span>'+reArray[i].RoadNo+'</span> '
+ '<span>'+compass_image(reArray[i].Bearing)+'</span> '
+ '</div><br/>'
j++;
}
for(i = 0; i < reArray.length; i++){
ERROR HERE -----> var placeFunction = function(reArray[i]){
plotRoadInfo(reArray[i]);
$(this).dialog("close");
};
myButtons[optionArray[i]] = placeFunction;
}
$( "#dialog-modal" ).dialog({
height: 300,
modal: true,
buttons: myButtons
});
$('#multipleRE').append(theHTML);
}
So the function gets passed an object array (reArray), it then creates an array of buttons (myButtons) for a jquery dialog box. I'm attempting to to pass reArray[i] to the function that will be used by each button, which is to execute plotRoadInfo(reArray[i]);
I keep getting "Unexpected token [", and I can't figure out why for the life of me.