We want to refresh whole page on button click using jQuery. we use location.reload() method because this method is used for refresh page.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Reload/Refresh Page</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#btnSubmit').click(function () {
location.reload();
});
});
</script>
</head>
<body>
<input id="btnSubmit" type="button" value="Submit" />
</body>
</html>
just put this code in html page and press submit button, it will refresh whole page.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Reload/Refresh Page</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#btnSubmit').click(function () {
location.reload();
});
});
</script>
</head>
<body>
<input id="btnSubmit" type="button" value="Submit" />
</body>
</html>
just put this code in html page and press submit button, it will refresh whole page.
Comments
Post a Comment