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

237
Views
La extensión del servidor vscode live corta el código JavaScript

Estoy tratando de hacer un sistema de reservas en línea. Y estoy usando el servidor en vivo de vscode para la web en vivo para las pruebas. Me di cuenta de que corta una gran parte del código js. Estoy usando la versión más reciente de vscode y google chrome. Si necesitas más información, no dudes en preguntarme :).

Comportamiento esperado:

 <script> window.addEventListener("DOMContentLoaded", function () { // get the form elements defined in your form HTML above var form = document.getElementById("my-form"); // var button = document.getElementById("my-form-button"); var status = document.getElementById("status"); // Success and Error functions for after the form is submitted function success() { form.reset(); status.classList.add("success"); status.innerHTML = "Thanks!"; } function error() { status.classList.add("error"); status.innerHTML = "Oops! There was a problem."; } // handle the form submission event form.addEventListener("submit", function (ev) { ev.preventDefault(); var data = new FormData(form); ajax(form.method, form.action, data, success, error); }); }); // helper function for sending an AJAX request function ajax(method, url, data, success, error) { var xhr = new XMLHttpRequest(); xhr.open(method, url); xhr.setRequestHeader("Accept", "application/json"); xhr.onreadystatechange = function () { if (xhr.readyState !== XMLHttpRequest.DONE) return; if (xhr.status === 200) { success(xhr.response, xhr.responseType); } else { error(xhr.status, xhr.response, xhr.responseType); } }; xhr.send(data); } </script>

Comportamiento real:

 <script> window.addEventListener("DOMContentLoaded", function () { // get the form elements defined in your form HTML above var form = document.getElementById("my-form"); // var button = document.getElementById("my-form-button"); var status = document.getElementById("status"); // Success and Error functions for after the form is submitted function succe</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Vuelva a cargar la página web y debería funcionar.

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!