My string javascript like this :
<script>
...
res += '<td class="${photo == photoMap[i].name ? 'success' : ''} image" id="thumb-view-'+i+'" \
data-toggle="modal" \
data-target="#modal-option-'+i+'" \
data-photo='${JSON.stringify(photoMap[i])}' \
data-main_photo="'+photo+'" \
> \
<img src="/img/thumbs/'+photoMap[i].name+'" alt="${photoMap[i].alt ? photoMap[i].alt : ''}"> \
${photo == photoMap[i].name ? '<div class="box-check"><span class="fa fa-check"></span></div>' : ''} \
</td>';
...
</script>
If the code executed, on the console exist error like this :
Uncaught SyntaxError: Unexpected identifier
It seems that the writing of the code is still not correct
If I observe, an error occurs in this section
res += '<td class="${photo == photoMap[i].name ? 'success' : ''} image" id="thumb-view-'+i+'" \
and
${photo == photoMap[i].name ? '<div class="box-check"><span class="fa fa-check"></span></div>' : ''} \
How can I solve it?
success+, I think you forgot to concatenate itsuccessis string. No variable', thus the compiler thought thatsuccessis not part of the string