Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

56
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!