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

204
Views
No se puede enviar la identificación usando el método HTTP Post

Quiero enviar la identificación de un botón cuando se hace clic en él utilizando el método HTTP Post, he escrito el siguiente código. Pero el servidor no recibe la identificación del botón cuando presiono el botón. ¿Podría alguien por favor guiarme, lo que está yendo mal aquí? Gracias de antemano.

 <HTML> <head> <script> function fun1(element) { var xhttp = new XMLHttpRequest(); xhttp.open("POST", "/prc", true); xhttp.send(element.id); //alert("ID":element.id); } </script> </head> <body> <button type="button" onclick="fun1(this)" id="img1">IMAGE</button> </body> </html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Le sugiero que use Fetch API ya que tiene una interfaz mucho más simple:

 function fun1(element) { fetch('/prc', { method: 'POST', body: element.id }) }
about 4 years ago · Juan Pablo Isaza 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!