我收到错误SCRIPT1003:在IE 11中预期':'; (Java脚本代码错误) [英] I get the error SCRIPT1003: Expected ':' in IE 11; (Java Script Code error)

查看:1203
本文介绍了我收到错误SCRIPT1003:在IE 11中预期':'; (Java脚本代码错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JS代码的这一特定片段在IE 11上不起作用。我收到错误SCRIPT1003:预期':'并且它表示它在线上缺少它以粗体显示。

This particular snippet of JS code does not work on IE 11. I get the error SCRIPT1003: Expected ':' and it says it is missing on line that it's in bold.

var $actions = application.service('$actions', [
function() {
    let _logout = function() {
        $('#logoutForm').submit();
    }
    return {
        **Logout() {**
            _logout();
        },
    };
}]);

任何想法?谢谢

推荐答案

IE11不支持速记方法名称。请参阅 MDN 的兼容性部分。使用

IE11 does not support shorthand method names. See the compatability part of the MDN. Use

return {
   Logout: function() {
       _logout();
   }
};

(或停止支持互联网爆炸,如果你有机会 - 它会引起很多麻烦)

(or stop supporting internet exploder, if you have the opportunity to - it causes a lot of headache)

这篇关于我收到错误SCRIPT1003:在IE 11中预期':'; (Java脚本代码错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆