I am trying to use jQuery to display the comment-section of my Wordpress-pages, but without requiring that jQuery be present on all pages that allows comments. Basically, I need the following:
- A method of activating jQuery (core) when the div containing the comments come into view.
This would then load jQuery, which in turn would load the comments-section of the page, but only when that section became visible through the browser viewport.
The problem seems to be that I really cannot use 'wp_enqueue_script' (Wordpress' generic way of adding scripts) for this, as it is a PHP-function. Is there some method that would allow me to implement a functionality as described above (without breaking Wordpress/jQuery-functionality)?