{"action":"created","issue":{"url":"https://api.github.com/repos/nprapps/pym.js/issues/95","labels_url":"https://api.github.com/repos/nprapps/pym.js/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/nprapps/pym.js/issues/95/comments","events_url":"https://api.github.com/repos/nprapps/pym.js/issues/95/events","html_url":"https://github.com/nprapps/pym.js/issues/95","id":95952465,"number":95,"title":"Initializes inline, rather than on document ready","user":{"login":"coreyhaines","id":3962,"avatar_url":"https://avatars.githubusercontent.com/u/3962?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyhaines","html_url":"https://github.com/coreyhaines","followers_url":"https://api.github.com/users/coreyhaines/followers","following_url":"https://api.github.com/users/coreyhaines/following{/other_user}","gists_url":"https://api.github.com/users/coreyhaines/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyhaines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyhaines/subscriptions","organizations_url":"https://api.github.com/users/coreyhaines/orgs","repos_url":"https://api.github.com/users/coreyhaines/repos","events_url":"https://api.github.com/users/coreyhaines/events{/privacy}","received_events_url":"https://api.github.com/users/coreyhaines/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-19T22:03:14Z","updated_at":"2015-07-20T12:31:19Z","closed_at":null,"body":"We ran into this issue when pym was included in the head of the document. Because the pym script auto-initializes at load time, not document ready, it doesn't see the div tags that have a data-pym-src attribute. We have to tell our clients to put the script include at the bottom of the page. This isn't always feasible.\r\nWould it be possible to have the initialization run at document load, so we have all the divs that mark an iframe ready?"},"comment":{"url":"https://api.github.com/repos/nprapps/pym.js/issues/comments/122869994","html_url":"https://github.com/nprapps/pym.js/issues/95#issuecomment-122869994","issue_url":"https://api.github.com/repos/nprapps/pym.js/issues/95","id":122869994,"user":{"login":"onyxfish","id":33046,"avatar_url":"https://avatars.githubusercontent.com/u/33046?v=3","gravatar_id":"","url":"https://api.github.com/users/onyxfish","html_url":"https://github.com/onyxfish","followers_url":"https://api.github.com/users/onyxfish/followers","following_url":"https://api.github.com/users/onyxfish/following{/other_user}","gists_url":"https://api.github.com/users/onyxfish/gists{/gist_id}","starred_url":"https://api.github.com/users/onyxfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onyxfish/subscriptions","organizations_url":"https://api.github.com/users/onyxfish/orgs","repos_url":"https://api.github.com/users/onyxfish/repos","events_url":"https://api.github.com/users/onyxfish/events{/privacy}","received_events_url":"https://api.github.com/users/onyxfish/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T12:31:19Z","updated_at":"2015-07-20T12:31:19Z","body":"@coreyhaines This is an interesting problem. It's a bit of a catch-22. We use onload because it will guarantee that inline images have loaded before it fires, which affects the height computation in the child frame if you're not using dynamic rendering. But I also understand that it creates an issue with pages where you may not control the placement of the javascript include. I'm open to suggestions about how to resolve the conflict.\r\n\r\n@miohtama Implicit initialization is a requirement for many users who are not able to add custom javascript blocks through their CMS."}}