The .load function in the Jquery Library is not working!

-1

<script>
$(".coment").load("coments.php #coments");
</script>

This function causes it to load comments after sending it! This causes the comment to be sent at the same time and viewed!

Only when I put this code to view the comments, it is not loading any comments! I checked if it's the div, if it's the "class" if it's the "id" but none will! I need help!

    
asked by anonymous 05.07.2016 / 07:03

1 answer

1

For the code snippet provided, you might not have expected the page to load. Try using the ready ( link ) method:

 <script type="text/javascript">
      $(document).ready(function()
               {
                  $(".coment").load("coments.php #coments");
               }
      );
 </script>
    
05.07.2016 / 13:38