Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

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

This code works in Chrome but in IE 11 returns the error SCRIPT1003: Expected ':' on line 5. I'd really appreciate any help.

Note: place and names are arrays that are previously defined, and repor is also a previously defined variable.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Usually objects in JavaScript are initialized as key value pairs, so data should probably be initialized like

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

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

In ECMAScript 2015 it seems you can omit the key part in certain situations, which is why it works on Chrome.

over 4 years ago · Santiago Trujillo Denunciar

0

I had the SCRIPT1003: Expected ':' error as well in IE 11 (and my code worked fine in Chrome & Firefox). If someone uses Knockoutjs and encounters this, watch out for the syntax when stating functions in your view model:

var viewModel = {
    property1: "",
    functionWorksInAllBrowsers: function (arg1, arg2) {
        // ...
    },
    functionThrowsErrorInInternetExplorer11(arg1, arg2) { 
        //...
    }
};
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda