I am trying to fit my website to all well known browsers In all browsers my JavaScript code is working, but not in Safari.
I get next error in Safari: "SyntaxError: Use of reserved word 'class'"
my code is look like:
class _MontInit {
constructor() {}
sendXMLHTTPRequest(url, data, method, callback, error) {
var xmlHTTP = new XMLHttpRequest(); // new HttpRequest instance
xmlHTTP.open(method, url);
xmlHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
xmlHTTP.onload = callback;
xmlHTTP.onerror = error;
xmlHTTP.setRequestHeader('Cache-Control', 'no-cache');
xmlHTTP.send(data);
}
}
The error placement is on class word before MontInit. One of the solution over Web was to add "use strict". but it did not help. Any ideas?