I am getting an "unexpected end of input" error on the last line below and if I keep removing the last line one at a time, the error prevails at the last line. I am trying this only with chrome.
I am using notepad++ and that doesn't throw up any errors or suggestions. I tried jedit but I am not too sure if any syntax checking is active or not in either case. N++ gives me autocomplete suggestions though.
Any idea what is wrong with this. The AJAX did complete twice while testing but this suddenly stopped working. Can't figure out what broke this.
<script type="text/javascript">
function postevac()
{
var location = document.getElementById("location").value ;
var nameno = document.getElementById("Nameno").value ;
var resources = document.getElementById("resources").value ;
var persons = document.getElementById("persons").value ;
var x = new XMLHttpRequest();
x.open("post", "http://localhost:5984/ch", true) ;
x.setRequestHeader("Content-type", "application/json") ;
var y = {
"location" : location ,
"nameno" : nameno ,
"resources" : resources ,
"persons" : persons ,
} ;
x.send(JSON.stringify(y)) ;
</script>