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 comment:1
Changed January 06, 2010 01:08AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | new → closed |
Javascript defines
classas a reserved word so it's bad Javascript syntax to say {class: "blah"} regardless of whether jQuery is used on the page or not.
You should use the proper api:
.addClass().removeClass()