If an ajax call can get the data, then any rogue or customized script can also get the data via the same ajax call and it only takes an elementary look at your web page to see what the ajax call is that gets the data. Or, anyone who just opens the Chrome developer tools and looks at the network tab can see the contents of all ajax calls made by the browser.
In addition, anyone who knows how to use a browser debugger can watch anything your code does (like storing ajax contents into a variable) so even encryption over the wire doesn't prevent someone seeing your data who is at the receiving browser.
If you want your server data to be secure, you will need a different design.
The secure way to test user input vs. some secret on the server is to send the client data to the server and have the server compare the client data to the server master and thus never send the server data to the client.
Think of it like a password. You'd never send the master password to the client and have the client compare what the user entered. Instead, you'd send what the client typed to the server and have the server do the comparison securely. This same approach will protect your data.