We use Ajax (Asynchronous JavaScript and XML) a web technology that allows a web page to dynamically update content without reloading the page within the browser for developing a website.Here I am explain how to change status OR div data using Ajax.

Program 1:

<Index.php
?php
$status = 'y';
?>
<div id="status">
<a href="#" onClick="changestatus('<?php echo $status; ?>')">Deactive</a>
</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
Function changestatus(status) {
var p_url= "post.php%