Pages Navigation Menu

Coding is much easier than you think

Refresh DIV Content Without Reloading Page using jQuery

In my previous post, I explained about making AJAX calls to a servlet from a JSP page and updating a part of the JSP page with the response from the Servlet.
This article will help you to Refresh DIV Content Without Reloading Page using jQuery with simple html page.

<TITLE>Refresh Div without Reloading Page</TITLE>
<script src=""></script>
	$(document).ready(function() {
		setInterval(function() {
			var randomnumber=Math.floor(Math.random()*100)
			$('#show').text('Random Number ==> '+randomnumber);
		}, 2000);
<div align="center">
<h3>Refresh DIV Content Without Reloading Page using jQuery</h3>
Demo by Mohaideen - @ <a href="" target="_blank">SimpleCodeStuffs</a>
<div id="show" style="padding:10px;border-radius:9px;border:3px solid #EE371A;width:50%;">
This div will get refreshed for every 2 seconds..! 

Another must read article


About Mohaideen Jamil

I'm a Full stack developer of IT exp in J2EE, AngularJs, MicroServices, Docker, Spring (Boot, MVC, Cloud), Bluemix, DevOps. Follow me on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.

%d bloggers like this: