I have an ajax request, and I would like to use the data what I get back from server side. I know the frontend code, but I don't know the backend. Please help me guys! My frontend code is here:
    <script>
            function login() {
               alert("alma");
               var sendInfo = {
               user: document.getElementById("username"),
               passwd: document.getElementById("password")
               };
       $.ajax({
        type: 'POST',
        url: 'HalloWorld',
        data: sendInfo, 
        dataType: 'json',
        contentType: 'application/.json',
        success: function(data) { 
                    //here I want to use my data from sever side
                    document.getElementById("newdata").innerHTML=data;
                 },
        error: function(jqXHR, textStatus, errorThrown) {
                    alert("error");
               }
    });
}
        </script>
    Username: <input type="text" id="username"/> <br/>
    Password: <input type="password" id="password"/> <br/>
    <input type="button" value="Login" onclick="login()"/>
    <div id="newdata"></div>
