I have a “comments” section on a webpage that I have hidden initially and when the user clicks the comments link the div tag (and comments) appear using the jQuery show/hide functions.
My question is: is it possible to load this content only when the comments link is clicked (not when the entire page is loaded)?
Given that
comments_linkandcomments_containerare the respective IDs:This technique uses Ajax to make a request to a URL asynchronously and injects the resulting HTML into the specified element.
See
jQuery.load