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

245
Views
JavaScript Ajax SCRIPT1003: ':' esperado en IE 11
 var url="tabla.php"; $.ajax({ type: "POST", url:url, data:{place,names,repor}, success: function(datos){ $('#tabla').html(datos); }

Este código funciona en Chrome pero en IE 11 devuelve el error SCRIPT1003: Expected ':' en la línea 5. Realmente agradecería cualquier ayuda.

Nota: place y los names son matrices que se definen previamente, y el repor también es una variable definida previamente.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Por lo general, los objetos en JavaScript se inicializan como pares de valores clave, por lo que los datos probablemente deberían inicializarse como

 data:{ place : place, names : names, report : report }

Consulte https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer

En ECMAScript 2015 parece que puede omitir la parte clave en ciertas situaciones, por lo que funciona en Chrome.

over 4 years ago · Santiago Trujillo Report

0

Tuve el SCRIPT1003: error ':' esperado también en IE 11 (y mi código funcionó bien en Chrome y Firefox). Si alguien usa Knockoutjs y encuentra esto, tenga cuidado con la sintaxis al establecer funciones en su modelo de vista:

 var viewModel = { property1: "", functionWorksInAllBrowsers: function (arg1, arg2) { // ... }, functionThrowsErrorInInternetExplorer11(arg1, arg2) { //... } };
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!