Introduction:
Here I will explain how to refresh page in jQuery or reload page in jQuery or refresh or reload webpage using jQuery.
Description:
In previous articles I explained jQuery set some time delay for function execution, jQuery keypress keydown and keyup events example, jQuery hide div element after 5 seconds, jQuery Remove first/last character from string, jQuery create rounded corners for textbox and many articles relating to JQuery. Now I will explain how to refresh or reload page using jQuery.
In previous articles I explained jQuery set some time delay for function execution, jQuery keypress keydown and keyup events example, jQuery hide div element after 5 seconds, jQuery Remove first/last character from string, jQuery create rounded corners for textbox and many articles relating to JQuery. Now I will explain how to refresh or reload page using jQuery.
To
refresh or reload webpage in jQuery
we need use location.reload() for
that need to write code like as shown below
<script type="text/javascript">
$(function()
{
$('#btnClick').click(function() {
location.reload();
})
})
</script>
|
If you
want see it in complete example need to write the code like as shown below
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery Refresh or Reload web Page</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function()
{
$('#btnClick').click(function() {
location.reload();
})
})
</script>
</head>
<body>
<div>
<input type="button" id="btnClick" value="Refresh" />
</div>
</body>
</html>
|
Live
Demo
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
5 comments :
are both the same , window.location.reload() and window.reload() or when to use when.
Great Info. Thanks for the your effort. Appreciate it.
Hi Suresh,
I need two things and I want you do that favour which will help me and other user/visitors of your site
1. auto scroll in any control in asp.net like google or other e-commerce sites.
2. payment gateway by CCAvenue, Paypal, and others.... that will use Credit Card, Debit Card, NetBanking and others....
sir can you help me in integrating payment gateway in asp.net C#
sir can you help me in integrating payment gateway in asp.net C#
Note: Only a member of this blog may post a comment.