Nikolaos Vassos Nikolaos Vassos - 1 year ago 279
jQuery Question

Syntax error, unrecognized expression in Safari

Hey guys I have been using this PrettyPhoto 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?

Answer Source

Seems like you are missing ] in jQuery("a[data-gal^='prettyPhoto'") selector.

jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({overlay_gallery: false, social_tools:false, hook: 'data-gal'});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download