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

168
Views
¿Cómo mostrar datos de PHP usando Jquery Ajax?

Estoy aprendiendo a usar Ajax en Jquery y no tengo idea de cómo mostrar el contenido que recibo de PHP. En el archivo php, solo estoy haciendo algunos cálculos y estoy haciendo eco del resultado (¿debería devolverlo en su lugar?), Pero el código a continuación no devuelve nada. No pasa nada, el div permanece vacío. Este es mi código php:

 $totaalPrice = $totaal; $roundUp = number_format($totaalPrice, 2, '.', ''); $replace = str_replace(".", ",", $roundUp); echo "Uw rit kost: € " . $replace . " euro<br>";

Así es como construí mi Ajax:

 $.ajax({ type: "POST", url: "brain.php", data: {km:km, time:time, day:day}, succes: function(price){ $('#showPrice').html(price).show(price); //This where I'm trying to display the result. }, error: function(){ alert('something went wrong..');} });
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

 $.ajax({ type: "POST", url: "brain.php", data: {km:km, time:time, day:day}, success: function(price){ $('#showPrice').html(price); }, error: function(){ alert('something went wrong..');} });
over 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!