Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#7996 closed bug (fixed)

Safari $('script').attr('event'); Bug

Reported by: nathanhammond Owned by:
Priority: high Milestone: 1.6
Component: attributes Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

This bug occurs when trying to use jQuery's .attr() on a script tag to access an attribute named "event". The bug is only known to occur in Safari (Version 5.0.3 (6533.19.4) - Mac), however it does not occur in Chrome, so the root issue is probably connected to WK's JavaScriptCore. So I suppose it also will manifest itself in some mobile browsers.

The full description of the bug and a simplified test case included here: https://gist.github.com/a1defd74d3710ef82a4e

(Also occurs in 1.4.2 and 1.4.4.)

Change History (3)

comment:1 Changed 6 years ago by danheberden

Milestone: 1.next1.6

Here's a full fledged test case: http://jsfiddle.net/danheberden/9hLzT/

This is a great example of the proposed attr rewrite for 1.6. The element in question has, in safari, a property "event" as well as the actual attribute ( in the attributes property is an array of the attrs ).

So right now, jQuery is on it's merry way until it sees that event does indeed exist on the object. It, thus, returns that instead of the actual attribute.

Anyway, for now, the work around is to do it yourself - but this will be something that's addressed in 1.6

comment:2 Changed 6 years ago by Rick Waldron

Component: unfiledattributes
Priority: undecidedhigh
Status: newopen

comment:3 Changed 6 years ago by timmywil

Resolution: fixed
Status: openclosed
Version: git1.5.2
Note: See TracTickets for help on using tickets.