Good afternoon,
I'm doing a User validation, but I can not receive the message I get. I have the following:
$(document).ready(function () {
$("#UEmail").change(function () {
$.ajax({
type: "POST",
url: "ValidarCorreo.jsp",
data: {
Correo: $("#UEmail").val()
}
})
.done(function (msg) {
if(msg==="true")
{
//Mostrar mensaje
}
});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="form-group">
<label class="col-sm-2 control-label">Correo Electronico:</label>
<div class="col-sm-10">
<div class="input-group m-b">
<span class="input-group-addon">@</span>
<input name="UEmail" id="UEmail" required type="text" class="form-control required email" placeholder="">
</div>
</div>
</div>
the variable msg what it contains is the following HTML:
"↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵<!DOCTYPE html>↵<html>↵ <head>↵ <meta http-
equiv="Content-Type" content="text/html; charset=UTF-8">↵ <title>JSP
Page</title>↵ ↵ </head>↵ <body>↵ false↵
</body>↵</html>↵"
This contains my JSP:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<%!
String Correo;
%>
</head>
<body>
<%
Correo=request.getParameter("Correo");
if(Correo=="[email protected]")
{
out.print("true");
}
else
{
out.print("false");
}
%>
</body>