Opened 10 years ago
Closed 10 years ago
#9110 closed bug (notabug)
Tooltip Widget breaks in IE
Reported by: | youngjl1 | Owned by: | youngjl1 |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.widget | Version: | 1.10.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
jQuery Version: 1.9.1
jQuery-UI Version: 1.9.2
Browser: IE8
OS: Windows
Steps to see what I'm talking about:
- Go here in chrome: http://jsfiddle.net/EP5Jx/#run
- Pull up Chrome Dev Tools -> Sources -> Open jquery-ui.js
- Add a break point on line 842 where it says
- hasOptions = !$.isEmptyObject( options );
- Hover over where it says "Some text"
- The code should stop at the break point, check the value of options. It is true.
Now, according to the documention of $.isEmptyObject (http://api.jquery.com/jQuery.isEmptyObject/)
The argument should always be a plain JavaScript Object as other types of object (DOM elements, primitive strings/numbers, host objects) may not give consistent results across browsers.
The boolean value of true is definitely not a plain JS Object and this actually does cause issues in IE. To see:
- Go to msn.com in Internet Explorer 8
- Pull up dev tools
- Switch Browser Mode to "IE8 Compat View"
- Switch Document Mode to "IE7 Standards"
- Switch to Script tab
- run the following script: true.toJSON()
running that script returns true because for some unknown reason the boolean value true has a method associated with it. In this weird case calling $.isEmptyObject(true) will actually return false when for any other browser it would return true, and in this case the widget will break.
Sorry I was unable to give straight-forward directions to reproduce this. This is the first time I've logged a jquery bug.
Change History (7)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Owner: | set to youngjl1 |
---|---|
Status: | new → pending |
I'm not seeing any errors in that jsFiddle example using IE 8. Your description doesn't sound like you're able to reproduce this either. I understand the technical point you're making about $.isEmptyObject()
, but I cannot reproduce the bug you're trying to report.
comment:3 Changed 10 years ago by
Status: | pending → new |
---|
You're able to use jsFiddle with IE 8? I get js errors trying to go to that site.
comment:4 Changed 10 years ago by
Status: | new → pending |
---|
Use http://jsfiddle.net/EP5Jx/show to just load the output.
comment:6 Changed 10 years ago by
Status: | pending → new |
---|
I've researched this some more and determined that the problem I was experiencing was not with the jQuery UI. Please close this bug.
comment:7 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Basically the widget shouldn't be passing a primitive boolean into $.isEmptyObject. It goes against the documentation of that method and in some cases with IE the widget will break.