reload html element jquery code example

Example 1: jquery reload page

$('#myElement').click(function() {
    location.reload();
});

Example 2: reload page jquery

location.reload();

Example 3: refresh div jquery

$("#mydiv").load(location.href + " #mydiv");

//this is actualy not so nice but it does the job.

Example 4: AJAX in reload a div container

(function($)
{
    $(document).ready(function()
    {
        $.ajaxSetup(
        {
            cache: false,
            beforeSend: function() {
                $('#content').hide();
                $('#loading').show();
            },
            complete: function() {
                $('#loading').hide();
                $('#content').show();
            },
            success: function() {
                $('#loading').hide();
                $('#content').show();
            }
        });
        var $container = $("#content");
        $container.load("rss-feed-data.php");
        var refreshId = setInterval(function()
        {
            $container.load('rss-feed-data.php');
        }, 9000);
    });
})(jQuery);