Skip to content

Instantly share code, notes, and snippets.

@aurorapar
Last active December 2, 2016 01:34
Show Gist options
  • Save aurorapar/220de6b0177104dd32d3b9b2dff6187f to your computer and use it in GitHub Desktop.
Save aurorapar/220de6b0177104dd32d3b9b2dff6187f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CS Deptartment</title>
<link href="css/style.css" rel="Stylesheet" type="text/css" />
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<script src="js/facultyMod.js"></script>
<script src="js/adminJsForm.js"></script>
<script src="js/formAjax.js"></script>
</head>
<body>
<header>
<div id="banner" class="schoolColors">
<div id="banner-content">
Computer Science Department
</div>
</div>
<ul id="header-list">
<li class="news-element schoolColors"><a href="http://www.winona.edu/">WSU Home</a></li>
<li class="news-element schoolColors"><a href="index.php">CS Deptartment</a></li>
<li class="news-element schoolColors"><a href="index.php">Department Projects</a></li>
<li class="news-element schoolColors"><a href="faculty.php">Faculty</a></li>
<li class="news-element schoolColors"><a href="index.php">Opportunities</a></li>
</ul>
</header>
<div id="content" class="nonheader">
<div class="content-focus schoolColors">
<button id = "button">Go</button>
<input type = "text" id = "faculty_id"></input>
<main>
</main>
<div id = "spot" height = "200" width = "200">
</div>
</div>
</div>
<p></p>
<p></p>
<p></p>
<footer>
<div class="centeredItem credits">
Copyright 2016<br>
Aurora Pariseau,
Catelyn Holm,
Matthew Ladin,
Ronald Hawley
</div>
</footer>
</body>
</html>
$( document ). ready(function() {
$("#button").click(callBack)
});
function callBack()
{
var changeMe = $( "#spot" );
var request = $.ajax({
url: "fac.php",
type: "POST",
data: {
"faculty_id": $( "#faculty_id" ).val(),
},
dataType: "html"
});
request.done(function(msg) {
changeMe.html(msg);
});
request.fail(function(msg) {
alert("AJAX CALL FAILED");
});
event.preventDefault();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment