jQuery and ASP.NET

July 3, 2009

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>

Drop a comment if this script does not work in any browser version.


Bookmark this link on del.icio.us (saved by 0 users)

Did you like this post?
kick it on DotNetKicks.com
subscribe via rss subscribe via e-mail
print this post follow me on twitter
Others Also Read..

comments

4 Responses to "How to Refresh/Reload a Page using jQuery"
  1. dodol said...
    October 29, 2009 6:58 AM

    if we must reload the page using a button, it's just the same like using the F5 key :D however, nice tuts :D

  2. Anonymous said...
    February 1, 2010 8:43 AM

    Great post Dude thanks a lot.

  3. Lady said...
    March 4, 2010 11:25 PM

    Wow thanks! .. I was wondering how to reload the page after having logged the user via ajax, to give him access to admin links!

    location.reload() did exactly what i wanted..

  4. Wazdesign said...
    May 7, 2010 3:02 AM

    thanks a lot its works cool

 

Copyright 2010 All Rights Reserved DevCurry.com by Suprotim Agarwal