New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make attr() work for non DOM element nodes. Fixes #7202, #7451, #7500. #92

2 commits merged into from Dec 6, 2010


None yet
1 participant

jitter commented Nov 10, 2010

The changes to attr() in 1.4.3 and 1.4.4 make it fail in various circumstances when used on non DOM element nodes.
These commit fix the exceptions and restore the 1.4.2 behavior when attr() was used on non DOM element nodes.

Currently this also works for non DOM nodes but that could be easily removed (with e.g. an additional check for ele.nodeName). As a comment of John Resig in #7202 indicates you shouldn't even use attr() on non DOM nodes.

jitter added some commits Nov 9, 2010

Partially revert commit a64dc04.
Removing the conditional was too liberal as now attr() would even work
on plain javascript objects. Keeping a check to make sure it is at least
a DOM Node is appropriate. Using nodeName as in the commit which introduced
the nodeType === 1 check seems plausible.
Make sure attr() works on non DOM element nodes. Fixes #7202, #7451, …

Also added some tests for this attr(name), attr(name, value) and removeAttr(name).

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment