//-----------------------------------------
$('a').each(function (i) {
$(this).on('click', {index:i}, function (event) {
- // Do we have a valid index?
+ // Is there a valid index?
if (indexTranslation[event.data.index] != null) {
// Prevent default action
event.preventDefault();