I have a plugin that uses thickbox on the frontend. The HTML button for the thickbox modal is:
<a href="#TB_inline?width=640&height=600&inlineId=modal-window-id" class="thickbox">My Link
</a>
A user is using the Divi theme. It registers an event that gets triggered when the above link is clicked:
$('a[href*="#"]:not([href="#"])').click(function () {
....
var target = $(this.hash);
....
});
The above line of code generates the following error:
Error: Syntax error, unrecognized expression #TB_inline?width=640&height=600&inlineId=modal-window-id jquery.js:2:12733
Can anyone see why this error is getting thrown?
2
Answers
Simply because
Is not a valid jQuery selector.
your selector is not valid. # is a special char and needs to be escaped like
a[href*=\#]:not([href=\#])
see https://api.jquery.com/category/selectors/