How to Refresh/Reload a Page using jQuery

I have seen this question asked in many forums, however the solution presented worked on selected browsers only. Here’s a solution I have tested that works on IE7, FireFox 3 and Chrome. Hopefully it should work on other browser versions as well!

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Reload/Refresh a Page in jQuery</title>
    <script type="text/javascript"
        src="http://code.jquery.com/jquery-latest.js">
    </script>

    <script type="text/javascript">
        $(document).ready(function() {
            $('#Button1').click(function() {
                location.reload();
            });
        });
    </script>
</head>
<body>
    <input id="Button1" type="button" value="button" />
</body>
</html>

[ad code=1]

http://www.devcurry.com/2009/07/how-to-refreshreload-page-using-jquery.html

Leave a comment