{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/sizzle/issues/309","labels_url":"https://api.github.com/repos/jquery/sizzle/issues/309/labels{/name}","comments_url":"https://api.github.com/repos/jquery/sizzle/issues/309/comments","events_url":"https://api.github.com/repos/jquery/sizzle/issues/309/events","html_url":"https://github.com/jquery/sizzle/issues/309","id":53439212,"number":309,"title":"Sizzle.attr assumes passes element supports getAttribute","user":{"login":"ayush","id":188701,"avatar_url":"https://avatars.githubusercontent.com/u/188701?v=3","gravatar_id":"","url":"https://api.github.com/users/ayush","html_url":"https://github.com/ayush","followers_url":"https://api.github.com/users/ayush/followers","following_url":"https://api.github.com/users/ayush/following{/other_user}","gists_url":"https://api.github.com/users/ayush/gists{/gist_id}","starred_url":"https://api.github.com/users/ayush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayush/subscriptions","organizations_url":"https://api.github.com/users/ayush/orgs","repos_url":"https://api.github.com/users/ayush/repos","events_url":"https://api.github.com/users/ayush/events{/privacy}","received_events_url":"https://api.github.com/users/ayush/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-05T20:19:19Z","updated_at":"2015-12-29T04:47:21Z","closed_at":"2015-01-05T20:52:47Z","body":"Inside `Sizzle.attr` [there is an assumption](https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L894) that the passed `elem` supports `getAttributes`. This isn't always true. As an example, the Comment element does not support this method. \r\n\r\nThis leads to errors such as those reported [here](http://stackoverflow.com/questions/27408501/ng-repeat-sorting-is-throwing-an-exception-in-jquery) or [here](http://stackoverflow.com/questions/26808658/backbone-view-jquery-sizzle-error) \r\n\r\nThe fix is to check if `elem` supports `getAttribute`. A condition like `elem.getAttribute !== undefined` should do the trick.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jquery/sizzle/issues/comments/167718418","html_url":"https://github.com/jquery/sizzle/issues/309#issuecomment-167718418","issue_url":"https://api.github.com/repos/jquery/sizzle/issues/309","id":167718418,"user":{"login":"znck","id":2596484,"avatar_url":"https://avatars.githubusercontent.com/u/2596484?v=3","gravatar_id":"","url":"https://api.github.com/users/znck","html_url":"https://github.com/znck","followers_url":"https://api.github.com/users/znck/followers","following_url":"https://api.github.com/users/znck/following{/other_user}","gists_url":"https://api.github.com/users/znck/gists{/gist_id}","starred_url":"https://api.github.com/users/znck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znck/subscriptions","organizations_url":"https://api.github.com/users/znck/orgs","repos_url":"https://api.github.com/users/znck/repos","events_url":"https://api.github.com/users/znck/events{/privacy}","received_events_url":"https://api.github.com/users/znck/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T04:47:21Z","updated_at":"2015-12-29T04:47:21Z","body":"@gibson042 Thanks :+1: "}}