<!DOCTYPE html>
<html>
<head>
<title>jQuery load() method</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").load('ajaxfile_load_params.html', function(response, status, xhr){
if(status == "success"){
alert("Success! File content loaded successfully!\nStatus: " + xhr.statusText);
}
if(status == "error"){
alert("Error: " + xhr.status + " " + xhr.statusText);
}
});
});
});
</script>
</head>
<body>
<div>
<p>It will hide after loads server file.</p>
</div>
<button>Load file</button>
</body>
</html>