Refresh a HTML div without page load AJAX

Today, We want to share with you ajax page load without refresh example.In this post we will show you refresh particular div using javascript, hear for auto refresh div content without reloading page using javascript we will give you demo and example for implement.In this post, we will learn about onclick refresh page without reload with an example.

how to refresh a div using javascript without refreshing page

There are the Following The simple About how to refresh a particular div using jquery Full Information With Example and source code.

As I will cover this Post with live Working example to develop load content into div without reloading page, so the how to refresh a particular div using jquery on button click is used for this example is following below.

Read Also:  remove special characters from string php

PHP Source Code

get-upcomming-movie.php

<?php
$upcommingmoviecontents = '<div>
<p>Tamilrockers is a torrent website that is immensely popular among south Indian movie fans. It is a desi version of the internationally notorious Pirate Bay from where one can download mostly South Indian movies and other content for free via a torrent client.</p>
</div>';
echo json_encode($upcommingmoviecontents);
?>

HTML Source Code

index.html

<!DOCTYPE html>
<html>
<title>jQuery Ajax Without Refresh webpage - www.pakainfo.com</title>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<style>
div {
 background-color: aquamarine;
 width:350px;
}
</style>
<body>

<button class="custom-refresher">Refresh Div</button>
<div id="results-to-refresh">
<p>Khatrimaza is a public torrent website. Khatrimaza not only leaks Bollywood movies, Hollywood movies and South movies but also series from various digital.</p>
</div>

<script type="text/javascript">
$(document).ready(function () {
	$(document).on('click', '.custom-refresher', function () {
		$.ajax({
			url: 'get-upcomming-movie.php',
			method: "GET",
			dataType: 'json',
			success: function(response) {
			   $('#results-to-refresh').html(response);
			}
		});
	});
});
</script>
</body>
</html>

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about ajax page load without refresh example.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.