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

345
Views
Variable en JavaScript, ¿por qué poner `var` no funciona?

Cuando coloco var delante de method y url ( var method y var url ), el código no funciona.

 function intervalcheck(theObject) { var xmlhttp = new XMLHttpRequest(), method = 'POST', url = 'https://thekmui.com/payb/payresult/result.php'; xmlhttp.open(method, url, true); xmlhttp.onload = function () {
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Echa un vistazo aquí:

 var xmlhttp = new XMLHttpRequest(), method = 'POST',

Está poniendo ',' (coma) después de cada línea. O lo dejas vacío y el navegador se encarga del resto. O puedes poner ';' punto y coma así:

 var xmlhttp = new XMLHttpRequest(); method = 'POST';

De lo contrario, el código producirá un error masivo. También puede seguir esta publicación: Enviar datos POST usando XMLHttpRequest

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!