1
refresh div with jquery
CGuild1.com > Tips & Tricks > refresh div with jquery

Refresh a DIV

How to refresh a div on a page with jQuery.

<?php
$(document).ready(function () {
    var interval = 500;   //number of mili seconds between each call
    var refresh = function() {
        $.ajax({
            url: "path/to/server/page.php",
            cache: false,
            success: function(html) {
                $('#server-name').html(html);
                setTimeout(function() {
                    refresh();
                }, interval);
            }
        });
    };
    refresh();
});

And the useage is <div id="server-name"></div>

I found this here at Stackoverflow
©2024 CGuild1.com