Return to Snippet

Revision: 43381
at March 23, 2011 04:19 by secretgspot


Initial Code
if ($('.autoupdate')[0]) {
    setInterval(function () {
        $.get(document.location, function (data) {
            $('.autoupdate').each(function () {
                var html = $(data).find('#' + $(this).id).html();
            });
        });
    }, 10000);
}​

Initial URL


Initial Description
Essentially it refreshes the content of any element in the page that has the “autoupdate” class on it. It uses the jQuery AJAX load method to get the page and replaces all the content within the new content from their matching IDs.

Initial Title
In-Page Element Updating/Refreshing

Initial Tags


Initial Language
jQuery