Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#5185 closed bug (wontfix)

Setting "cursor" CSS property to null causes MSIE to request "null" file from the server

Reported by: jmikola Owned by:
Priority: minor Milestone: 1.4
Component: attributes Version: 1.3.2
Keywords: cursor css null Cc:
Blocked by: Blocking:

Description

I discovered this quirk while using the BlockUI plugin, but its root cause is likely due to the relationship between jQuery and MSIE (noticed in browsers 6-8). Calling the following:

jQuery.css( { cursor: null } );

...on a selection leads MSIE to make a request to the local directory (to the current request URI) for the file "null". This is completely silent to the user, but noticeable while tailing server logs. Without Firebug in MSIE, I wasn't able to verify if the cursor property is actually unset, as most other properties would be if set to null in this manner. However, something is clearly wrong if MSIE is interpreting a literal null as a URL string (as it's neither a string, nor wrapped in "url()" like a background-image property value).

http://groups.google.com/group/jquery-en/browse_thread/thread/5c03405b82b31f55/41aff9b2b099f75a?lnk=raot

Change History (3)

comment:1 Changed 10 years ago by dmethvin

Component: unfiledattributes

See also #5163, we may want to normalize all null/undefined values to val/css/attr to be an empty string.

I don't think null is a valid value for the cursor property in any case, so this could be closed as a wontfix as well.

comment:2 Changed 9 years ago by addyosmani

Keywords: cursor css null added
Resolution: wontfix
Status: newclosed

Closing as null is not a valid value for the cursor property.

comment:3 Changed 9 years ago by jmikola

It's been quite a while since I originally opened this ticket, but at the time I believe setting the CSS property to null was the only way to remove/unset the property.

It appears in more recent 1.4 releases, passing null became unsupported and the proper solution for removing a property is to pass an empty string.

See: http://api.jquery.com/css/#comment-78552409

Note: See TracTickets for help on using tickets.