Ticket #1968 (closed bug: invalid)
"g has no properties" + fix
| Reported by: | daimoni | Owned by: | davidserduke |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.2.2 |
| Component: | core | Version: | 1.2.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hello.
There's a small in 1.2.1 that causes firefox to say "g has no properties" and ie display error on page when using $().hover.
No patch included, sorry.. but the bug is easy to notice -
Here's the fixed code.. Notice that hover: function takes f and g parameters, and after that initializes private function. However, in JQuery's code g-parameter is not passed to the private function at all, handleHover only takes e as parameter. Adding missing g to handleHover makes all shiny again.
Lines around 1900 or so:
hover: function(f,g) {
// A private function for handling mouse 'hovering'
function handleHover(e,g) {
// Check if mouse(over|out) are still within the same parent element
var p = e.relatedTarget;
Change History
comment:1 Changed 5 years ago by davidserduke
- need changed from Review to Test Case
- Owner set to davidserduke
- Status changed from new to assigned
comment:2 Changed 5 years ago by davidserduke
- Status changed from assigned to closed
- Resolution set to invalid
The only way I've been able to get that message is when the second function parameter is missing like happened in ticket #1754. If you have an actual test case where this happens please reopen the bug and attach it.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

I am unable to reproduce this bug in IE7. Does the wiki not work for you?
http://docs.jquery.com/Events/hover#overout
It shouldn't be necessary to pass in 'g' since it would be included by closure since the handleHover() function is inside hover(). If the wiki works but you still have a test case that fails please attach it otherwise this bug will be closed.