Skip to content

Instantly share code, notes, and snippets.

@jameshibbard
Last active December 30, 2015 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameshibbard/7766292 to your computer and use it in GitHub Desktop.
Save jameshibbard/7766292 to your computer and use it in GitHub Desktop.
Get employee data via AJAX (1)
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>AJAX filter demo</title>
</head>
<body>
<h1>Temporary Worker Database</h1>
<div id="workers"></div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
function updateEmployees(){
$.ajax({
type: "POST",
url: "submit.php",
dataType : 'json',
cache: false,
success: function(records){
$('#workers').text(JSON.stringify(records, null, 4));
}
});
}
updateEmployees();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment