{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/jquery/issues/3347","repository_url":"https://api.github.com/repos/jquery/jquery","labels_url":"https://api.github.com/repos/jquery/jquery/issues/3347/labels{/name}","comments_url":"https://api.github.com/repos/jquery/jquery/issues/3347/comments","events_url":"https://api.github.com/repos/jquery/jquery/issues/3347/events","html_url":"https://github.com/jquery/jquery/issues/3347","id":181556336,"number":3347,"title":"Is it possible to support native custom event handlers?","user":{"login":"kt3k","id":613956,"avatar_url":"https://avatars.githubusercontent.com/u/613956?v=3","gravatar_id":"","url":"https://api.github.com/users/kt3k","html_url":"https://github.com/kt3k","followers_url":"https://api.github.com/users/kt3k/followers","following_url":"https://api.github.com/users/kt3k/following{/other_user}","gists_url":"https://api.github.com/users/kt3k/gists{/gist_id}","starred_url":"https://api.github.com/users/kt3k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kt3k/subscriptions","organizations_url":"https://api.github.com/users/kt3k/orgs","repos_url":"https://api.github.com/users/kt3k/repos","events_url":"https://api.github.com/users/kt3k/events{/privacy}","received_events_url":"https://api.github.com/users/kt3k/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-07T00:19:32Z","updated_at":"2016-10-07T01:39:54Z","closed_at":"2016-10-07T01:39:53Z","body":"### Description ###\r\n\r\njQuery doesn't seem supporting native custom event handlers. For example, in the following code, the event handler doesn't run:\r\n\r\n```\r\ndocument.body.addEventListener('custom-event', function () { console.log('native custom-event handler'); })\r\n$(document.body).trigger('custom-event') // This doesn't fire the above handler.\r\n```\r\n\r\nThe above behavior seems a bit strange to me because if I attach to the event like `$('body').on('custom-event', ...)`, then it just works.\r\n\r\nI'm curious whether it's possible for jquery to support the above situation.\r\n\r\n### Link to test case ###\r\n\r\nhttps://jsfiddle.net/kt3k/og4cu6sm/\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jquery/jquery/issues/comments/252133531","html_url":"https://github.com/jquery/jquery/issues/3347#issuecomment-252133531","issue_url":"https://api.github.com/repos/jquery/jquery/issues/3347","id":252133531,"user":{"login":"dmethvin","id":157858,"avatar_url":"https://avatars.githubusercontent.com/u/157858?v=3","gravatar_id":"","url":"https://api.github.com/users/dmethvin","html_url":"https://github.com/dmethvin","followers_url":"https://api.github.com/users/dmethvin/followers","following_url":"https://api.github.com/users/dmethvin/following{/other_user}","gists_url":"https://api.github.com/users/dmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/dmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmethvin/subscriptions","organizations_url":"https://api.github.com/users/dmethvin/orgs","repos_url":"https://api.github.com/users/dmethvin/repos","events_url":"https://api.github.com/users/dmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/dmethvin/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T01:39:53Z","updated_at":"2016-10-07T01:39:53Z","body":"Yes, jQuery doesn't trigger native events, only the ones that it tracks. Native events don't provide a way to determine when they're attached."}}
{"actor":{"display_login":"dmethvin"}}