This is bizarre – a script on my page is breaking in Safari 5.0.5 due to a “syntax error,” but the same script works perfectly on another machine running Safari 5.0.6, and a third machine running Safari 5.1.
I can’t share the full script, but the line in question is:
$("").attr({href: "#", "data-id": value.aid, class: "artist"}).text(value.artist).wrap("").parent().fadeIn("fast").appendTo(list);
The exact error is:
SyntaxError: parse error
And I’m using jQuery 1.7.1, the current version, which is listed as compatible with Safari 5.0.x.
Any ideas what the “parse error” would be, given that the script does work fine in newer versions of Safari?
I got it – instead of adding the class inside
attr(), I did it like this:$("").attr({href: "#", "data-id": value.aid}).addClass("artist").text(value.artist).wrap("").parent().fadeIn("fast").appendTo(list);
@Ustun, I imagine your way would work too.