CIS 119 - Ajax Reverse (jQuery version)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Reverse a string</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
function callAjax() {
$.get("reverse.php",
{text:$('#txt1').val()},
function(msg) {
$('#result').html(msg);
},
"text"
);
return false;
}
</script>
</head>
<body>
<form onsubmit="return callAjax();">
Input: <input type="text" id="txt1"><br>
<input type="submit" value="Reverse It!">
</form>
<div id="result"></div>
</body>
</html>