Skip to main content

Bug Tracker

Side navigation

#5405 closed enhancement (invalid)

Opened October 23, 2009 03:55PM UTC

Closed January 06, 2010 01:08AM UTC

Use of "class" key in "attr()" properties object caused Safari to fail to load

Reported by: acoleman616 Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: attribute, attr, class Cc:
Blocked by: Blocking:
Description

I had the following line of code in my JS file:

$(object).attr({ class: 'myClass' });

It caused Safari to fail to load my entire page. When I changed class to className, it worked:

$(object).attr({ className: 'myClass' });

I feel this should either be well documented or fixed in the code to account for the use of the "class" key name.

Attachments (0)
Change History (2)

Changed October 24, 2009 01:51AM UTC by pbcomm comment:1

You should use the proper api:

.addClass().removeClass()

Changed January 06, 2010 01:08AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

Javascript defines

class
as a reserved word so it's bad Javascript syntax to say {class: "blah"} regardless of whether jQuery is used on the page or not.