Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

57
Vistas
AJAX Request not making

AJAX Code:-

$("#email").change(function(){
  alert('email changed');
  var Email = {
      email: $('#email').val()
  }
  var formsubmission = 'http://127.0.0.1/heropet/Common/check_mail';
  $.ajax({
    method: "POST",
    url: formsubmission,
    data: Email,
    success: function(response){
      alert(response);
    }
  });

HTML Code:

<label>E-mail</label>
<input type="text" name="email" id="email" value=""><br>

I don't know but it not making AJAX request in XAMPP Web server. How can I resolve this error? And sorry for my weak English.

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Error:-

1.closing });missed of $("#email").change(function(){

Working example code:-

$("#email").change(function(){
  alert('email changed');
  var Email = $('#email').val();
  var formsubmission = 'http://127.0.0.1/heropet/Common/check_mail';
  $.ajax({
    method: "POST",
    url: formsubmission,
    data: {email:Email},
    success: function(response){
      alert(response);
    }
  });
 });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>E-mail</label>
<input type="text" name="email" id="email" value=""><br>

Note:- add a proper jquery library as i have added into my example.

about 4 years ago · Santiago Trujillo Denunciar

0

You are missing "})" at the end.

Also wrap it in $( document ).ready(function(){})

As shown below:

    $( document ).ready(function(){
    $("#email").change(function(){
        alert('email changed');
        var Email = {
            email: $('#email').val()
        }
        var formsubmission = 'http://127.0.0.1/heropet/Common/check_mail';
        $.ajax({
            method: "POST",
            url: formsubmission,
            data: Email,
            success: function(response){
                alert(response);
            }
        });
    });
});
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda