Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to live update DOM with ajax?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #169178
    sayedtaqui
    Participant

    I have created a website on my company intranet where employees can upload their work and recieve feedbacks from their supervisors and managers. And now I m trying to do something like facebook does, when somebody leaves a comment or does any activity you get a notification while you are on the page.

    So I did it using jQuery ajax, and I m making ajax request to check the database after every 8 seconds using setInterval(); and its working fine however I was thinking if there is some better way of doing it. I mean is there any plugin which has been creating specially for doing this.

    Thanks
    Sayed Taqui

    #169303
    Mary Parker
    Participant

    I think this code will help you. <html>
    <head>
    <script type=”text/javascript” src=”jquery-1.3.2.min.js”></script>
    <script>
    $(document).ready(function(){
    $(“.edit”).click(function(){
    $(this).parent().load(“edit”);
    });
    $(“.view”).click(function(){
    $(this).parent().load(“view”);
    });
    });
    </script>
    </head>
    <body>

    <input type=’submit’ class=’edit’ value=’Edit’>

    </body>
    </html>

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.