Hattabitos | Posts: 24

Syntax error, unrecognized expression in Safari

0 votes
I have been using this code:
jQuery("a[data-gal^='prettyPhoto'").prettyPhoto({overlay_gallery: false, social_tools:false, hook: 'data-gal'});
And it is working fine on all browsers except Safari which throws an Error: Syntax error, unrecognized expression: a[data-gal^='prettyPhoto' Do you have an advice or an idea of what Safari doesn't like?

Attachments
1-3.png32.14 KB
Approved Answer
harishaidary | Posts: 1812

Reply to: Syntax error, unrecognized expression in Safari

1 votes
It looks like you're possibly missing a ] in jQuery("a[data-gal^='prettyPhoto'") selector. Try this:
jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({overlay_gallery: false, social_tools:false, hook: 'data-gal'});
Other browsers such as Chrome might be more lenient and close the selector. However, it is still a syntax error. Let me know if this works for you.

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off