javascript Ajax SCRIPT1003: Expected ':' in IE 11 javascript Ajax SCRIPT1003: Expected ':' in IE 11 ajax ajax

javascript Ajax SCRIPT1003: Expected ':' in IE 11


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.


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) {         //...    }};