<!DOCTYPE html>
<html>
<head>
<title>jQuery ajax() method</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.ajax({
url: "ajaxfile.txt",
success: function(result){
$("div").html(result);
}
});
});
});
</script>
</head>
<body>
<div>This text replace with new contains</div>
<button>Click here to call ajax() method</button>
</body>
</html>