Skip to main content

Bug Tracker

Side navigation

#7996 closed bug (fixed)

Opened January 18, 2011 04:39AM UTC

Closed April 15, 2011 03:00AM UTC

Last modified March 13, 2012 02:35PM UTC

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.)

Attachments (0)
Change History (3)

Changed January 18, 2011 09:12AM UTC by danheberden comment:1

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

Changed January 18, 2011 01:30PM UTC by rwaldron comment:2

component: unfiledattributes
priority: undecidedhigh
status: newopen

Changed April 15, 2011 03:00AM UTC by timmywil comment:3

resolution: → fixed
status: openclosed
version: git1.5.2