I have been utilizing a crossword application from this specific repository: https://github.com/jweisbeck/Crossword . The issue I am facing is that the program is using jquery version 1.6.2 while my entire project is built on jquery-3.1.1 version. The error seems to be originating from this part of the code:
buildEntries: function() {
var puzzCells = $('#puzzle td'),
light,
$groupedLights,
hasOffset = false,
positionOffset = entryCount - puzz.data[puzz.data.length-1].position; // difference between total ENTRIES and highest POSITIONS
for (var x=1, p = entryCount; x <= p; ++x) {
var letters = puzz.data[x-1].answer.split('');
for (var i=0; i < entries[x-1].length; ++i) {
light = $(puzzCells +'[data-coords="' + entries[x-1][i] + '"]');
if($(light).empty()){
console.log($(light));
$(light)
.addClass('entry-' + (x-1) + ' position-' + (x-1) )
.append('<input maxlength="1" val="" type="text" tabindex="-1" />');
}
}
}
// Put entry number in first 'light' of each entry, skipping it if already present
console.log(entries);
console.log(puzz.data);
for (var i = 0; i < entryCount; i++) {
$groupedLights = $('.entry-' + i);
if(!$('.entry-' + i +':eq(0) span').length){
$groupedLights.eq(0)
.append('<span>' + puzz.data[i].position + '</span>');
}
}
util.highlightEntry();
util.highlightClue();
$('.active').eq(0).focus();
$('.active').eq(0).select();
}
The error seems to be occurring at the line:
light = $(puzzCells +'[data-coords="' + entries[x-1][i] + '"]');
The browser displays this error message:
Error: Syntax error, unrecognized expression [object Object][data-coords="1,6"]
I suspect this could be due to the jQuery version compatibility issue or maybe the program is using [object Object] as an index. Since I am new to jQuery, I am unsure about the exact reason. I attempted to use jQuery Migrate without success. Additionally, trying to switch back to jQuery 1.6.2 also didn't help as the web browser couldn't locate jQuery at all due to me working with Typescript and having to install jQuery through a .d.ts file. Any tips or suggestions? Thank you in advance.