<a href="#" id="myLink">Click me!</a> <div id="result">The text will get loaded here</div> <script> $ ("#myLink").on("click", function(){ $ ("#result").load("https://ex.com/wp-content/themes/../comments.php"); }); </script>
I asked this code to load the comments after clicking, but it does not work