{"id":3003,"date":"2014-06-09T14:07:20","date_gmt":"2014-06-09T14:07:20","guid":{"rendered":"http:\/\/webninjataylor.com\/library\/?p=3003"},"modified":"2014-08-07T16:01:02","modified_gmt":"2014-08-07T16:01:02","slug":"event-binding-woes","status":"publish","type":"post","link":"https:\/\/webninjataylor.com\/library\/event-binding-woes\/","title":{"rendered":"Event Binding Woes"},"content":{"rendered":"<p>In addition to viewing current events bound to an object with &#8230;<\/p>\n<pre>$._data( $('SELECTOR')[0], 'events' );<\/pre>\n<p>&#8230;in the console. \u00a0I&#8217;ve discovered it is sometimes necessary to bind the event to a parent which already exists on the page as some scenarios don&#8217;t have all objects ready when the .ready() method is fired (*ahem* SharePoint, I&#8217;m looking over my glasses at <em>you<\/em>). \u00a0This can be accomplished with the following&#8230;<\/p>\n<pre>$('PARENT_OBJECT').on('EVENT', 'ACTUAL_OBJECT', function(){...});<\/pre>\n<p>&#8230;Also, it&#8217;s worth trying the .live() method for event binding future elements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In addition to viewing current events bound to an object with &#8230; $._data( $(&#8216;SELECTOR&#8217;)[0], &#8216;events&#8217; ); &#8230;in the console. \u00a0I&#8217;ve discovered it is sometimes necessary to bind the event to a parent which already exists on the page as some scenarios don&#8217;t have all objects ready when the .ready() method is fired (*ahem* SharePoint, I&#8217;m [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[144],"tags":[9,27,150],"class_list":["post-3003","post","type-post","status-publish","format-standard","hentry","category-web-shots","tag-javascript","tag-jquery","tag-sharepoint"],"_links":{"self":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/comments?post=3003"}],"version-history":[{"count":4,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3003\/revisions"}],"predecessor-version":[{"id":3332,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3003\/revisions\/3332"}],"wp:attachment":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/media?parent=3003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/categories?post=3003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/tags?post=3003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}