I am trying to make an Ajax call in my Thymeleaf page. So here is the code
<script>
        function getTodayRequest(){
            console.log("here is today");
            var xhttp=new XMLHttpRequest();
            xhttp.onreadystatechange=function(){
                if(this.readyState==4 && this.status==200){
                document.getElementById("received").innerHTML=
                    this.responseText;
                }
            };
            xhttp.open("GET","URI",true);
        }
</script>
So it complins with the error:
the entity name must immediately follow the '&' in the entity reference. java
and i have changed the & with & and now it looks like:
if(this.readyState==4 && this.status==200)
but now again it complains with:
Uncaught SyntaxError: Unexpected token ;
In the second &
How can i handle it?
 
     
    