Likes: change how resources are loaded to allow for defer loading #868

jeherve opened this Issue Jul 17, 2014 · 0 comments


None yet
1 participant

jeherve commented Jul 17, 2014

In likes.php likes_master() writes lot of javascript which depends on jQuery (and the postmessage class). I didn't find a reason to enqueue this code in the right way.
Suggested solution:
wrap the javascript code in a separate file for example likes/queuehandler.js enqueue this file in action_init()

wp_enqueue_script( 'queuehandler', plugin_dir_url( __FILE__ ).'likes/queuehandler.js', array( 'jquery','postmessage' ), '20131107' );

Original trac ticket:

@jeherve jeherve added a commit to jeherve/jetpack that referenced this issue Aug 8, 2014

@jeherve jeherve Likes: move inline js to separate file, enqueued in footer
Makes it easier to manipulate that js later on
Fixes #868

blobaugh closed this in #971 Aug 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment