Bug Tracker

Ticket #7996 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

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

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


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

comment:1 Changed 5 years ago by danheberden

  • Milestone changed from 1.next to 1.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 5 years ago by rwaldron

  • Priority changed from undecided to high
  • Status changed from new to open
  • Component changed from unfiled to attributes

comment:3 Changed 5 years ago by timmywil

  • Status changed from open to closed
  • Version changed from git to 1.5.2
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.