#11933 closed bug (invalid)
IE8 & 9 : Get script error after trigger click() - SCRIPT5007: Unable to get value of the property 'disabled': object is null or undefined
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In both IE 8 & 9, getting script error below after trigger click().
SCRIPT5007: Unable to get value of the property 'disabled': object is null or undefined jquery-min.js, line 113 character 246
From the debugger, notice in the f.event dispatcher method, the condition to check whether the target element is disabled, the child attribute "disable" is accessed before checking the parent object is null, in this case c.target was null, therefore calling c.target.disabled gets the error above.
if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){ ... }
Change History (4)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
After visiting this issue some more, I found that it was caused by using live() to bind events to an object that's not yet exisiting. Replacing using on() or bind() in ready(), Fixed the problem. This problem only happened in IE(8 and 9) browsers.
This ticket can be closed as not a bug.
comment:3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:4 Changed 10 years ago by
Try that
Inside your Internet window
In the toolbar, go in Tool
After, go in Internet Options
And inside the tab: Advanced
Than inside the browsing section, take off the X in front of: Display anotification about every script error
Found the uncompressed code, for jquery 1.7.1.
event.target is null, therefore event.target.disabled gives the error SCRIPT5007: Unable to get value of the property 'disabled': object is null or undefined jquery-min.js, line 113 character 246
I looked in jquery 1.7.2, the same problem exist but the code is different:
in the for loop, cur.parentNode is null, if I switch it to
the if condition below breaks, as cur is still null. Had to add another null check before cur.disabled !== true to fix the problem.