Here is the two javascript functions:
function testAjax() {
$word = $('#word').val();
return $.ajax({
url: "http://test.movies.9pstudio.com:8080/wordchain/wordsearch",
type: 'POST',
data: {
word: word
},
});
}
function validation() {
var reply = testAjax();
var x = document.getElementById("word").value;
alert(reply);
if (reply.equals("word not exist")) {
document.getElementById("error").innerHTML = reply;
} else {
document.getElementById("word1").innerHTML = reply;
send.push(result);
}
document.getElementById("word").value = "";
}
$wordis initialized but not used ever?wordnot$word.