2

Can someone please show me how i can add an automatic page refresh after the following jquery event has taken place?

Thanks.

<script>
    $(document).ready(function() {
        setTimeout(function() {
            $(".infobox-forum").fadeOut("slow", function () {
                $("infobox-forum").remove();
            });         
        }, 2000);
     });         
 </script>
Tim S. Van Haren
  • 8,723
  • 2
  • 29
  • 34
Fred Junior
  • 31
  • 1
  • 2

1 Answers1

3

Yes, you can use location.reload() to do this:

$(document).ready(function(){
    setTimeout(function(){
        $(".infobox-forum").fadeOut("slow", function () {
            $("infobox-forum").remove();
            location.reload(); // <---
        });
    }, 2000);
});

Another posibility is to use window.location.href = window.location.href instead. To decide which one to choose, see this question.

Community
  • 1
  • 1
Zar
  • 6,586
  • 8
  • 50
  • 76