{"action":"created","issue":{"url":"https://api.github.com/repos/CalderaWP/Caldera-Forms/issues/259","repository_url":"https://api.github.com/repos/CalderaWP/Caldera-Forms","labels_url":"https://api.github.com/repos/CalderaWP/Caldera-Forms/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/CalderaWP/Caldera-Forms/issues/259/comments","events_url":"https://api.github.com/repos/CalderaWP/Caldera-Forms/issues/259/events","html_url":"https://github.com/CalderaWP/Caldera-Forms/issues/259","id":107230845,"number":259,"title":"Request: Change inline javascript to allow jquery inclusion in footer","user":{"login":"eli-g","id":1821259,"avatar_url":"https://avatars.githubusercontent.com/u/1821259?v=3","gravatar_id":"","url":"https://api.github.com/users/eli-g","html_url":"https://github.com/eli-g","followers_url":"https://api.github.com/users/eli-g/followers","following_url":"https://api.github.com/users/eli-g/following{/other_user}","gists_url":"https://api.github.com/users/eli-g/gists{/gist_id}","starred_url":"https://api.github.com/users/eli-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eli-g/subscriptions","organizations_url":"https://api.github.com/users/eli-g/orgs","repos_url":"https://api.github.com/users/eli-g/repos","events_url":"https://api.github.com/users/eli-g/events{/privacy}","received_events_url":"https://api.github.com/users/eli-g/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-09-18T16:05:17Z","updated_at":"2016-08-18T09:16:14Z","closed_at":null,"body":"In your fields templates you often have inline javascript such as the button field:\r\n\r\njQuery( function($){\r\n\r\n\t\t$(document).on('click dblclick', '#<?php echo $field_id; ?>', function( e ){\r\n\t\t\t$('#<?php echo $field_id; ?>_btn').val( e.type ).trigger('change');\r\n\t\t});\r\n\r\n\t});\r\nTo maximise our page speed insights score we need to load our javascript in the footer of our website, which makes this code break, as jQuery is not loaded yet when this attempts to execute. To fix this I change the code to:\r\n\r\nwindow.onload = function(){\r\n\r\n\t\t$(document).on('click dblclick', '#<?php echo $field_id; ?>', function( e ){\r\n\t\t\t$('#<?php echo $field_id; ?>_btn').val( e.type ).trigger('change');\r\n\t\t});\r\n\r\n\t}\r\nIs there a chance this change (or something similar) could be incorporated into your plugin please?\r\n\r\nThanks,\r\nEllie"},"comment":{"url":"https://api.github.com/repos/CalderaWP/Caldera-Forms/issues/comments/240668419","html_url":"https://github.com/CalderaWP/Caldera-Forms/issues/259#issuecomment-240668419","issue_url":"https://api.github.com/repos/CalderaWP/Caldera-Forms/issues/259","id":240668419,"user":{"login":"alexandergryth","id":852682,"avatar_url":"https://avatars.githubusercontent.com/u/852682?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandergryth","html_url":"https://github.com/alexandergryth","followers_url":"https://api.github.com/users/alexandergryth/followers","following_url":"https://api.github.com/users/alexandergryth/following{/other_user}","gists_url":"https://api.github.com/users/alexandergryth/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandergryth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandergryth/subscriptions","organizations_url":"https://api.github.com/users/alexandergryth/orgs","repos_url":"https://api.github.com/users/alexandergryth/repos","events_url":"https://api.github.com/users/alexandergryth/events{/privacy}","received_events_url":"https://api.github.com/users/alexandergryth/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T09:16:14Z","updated_at":"2016-08-18T09:16:14Z","body":"Any news on this issue? Seems like it's still necessary to load jQuery in the header instead of footer to avoid errors."}}
{"actor":{"display_login":"alexandergryth"}}