}
}
}
}
}
}
}
}
}
}
});
});
});
});
});
});
</body>
<body>
comment="correct";
<div id="history"> </div>
<div id="status"></div>
<!DOCTYPE html>
} else {
} else {
} else {
} else {
</form>
</form>
<form id="newGameForm">
<form id="playForm"> 
for(var i=0;i<data['history'].length;i++){
$(function(){
function getHistory(){
function guess(param){
function newGame(){
function showPlayForm(value){
getHistory();
getHistory();
$.getJSON("getHistory.php", {}, function(data){
$.getJSON("guess.php", {guess: param}, function(data){
$.getJSON("newGame.php", {}, function(data){
$('#guessButton').on('click',function(){
guess($('#guessText').val());
$("#guessText").val("");
<h3>Guess Game</h3>
</head>
<head>
$('#history').html(html);
</html>
html+="<br/> Guess "+(i+1)+": "+data['history'][i].guess+" was "+comment;
<html lang="en">
if(data['history'][i].comparison=="="){
if(data['history'][i].comparison==">")comment="too large";
if(data['history'][i].comparison=="<")comment="too small";
if(data['status']=='ok'){
if(data['status']=='ok'){
if(data['status']=='ok'){
if(isWon)showPlayForm(false);
if(value){
<input id="guessButton" type="button" value="guess" />
<input id="newGameButton" type="button" value="new game" />
<input type="text" id="guessText" /> 
isWon=true;
<meta charset="utf-8">
newGame();
$('#newGameButton').on('click',function(){
$("#newGameForm").hide();
$("#newGameForm").show();
$("#playForm").hide();
$("#playForm").show();
</script>
<script>
<script src="jquery-2.1.0.js"></script>
showPlayForm(false);
showPlayForm(true);
$("#status").html("");
$("#status").html("");
$("#status").html("");
$("#status").html(data['status']);
$("#status").html(data['status']);
$("#status").html('Error');
var comment="";
var html="";
var isWon=false;
