简体   繁体   English

moment.js错误“不支持indexOf”

[英]moment.js error “indexOf not supported”

I have downloaded the latest version of moment.js and tried this example from their website in my code: 我已经下载了最新版本的moment.js并在我的代码中从其网站尝试了此示例:

alert(moment().subtract(10, 'days').calendar());

I get a message that the property or method IndexOf is not supported by this object. 我收到一条消息,指出该对象不支持属性或方法IndexOf。

I'm using Internet Explorer 11. 我正在使用Internet Explorer 11。

How can I solve this? 我该如何解决?

Thanks for the responses. 感谢您的答复。 This was helpfull. 这很有帮助。 Turned out that this line was in the way: 原来这条线是这样的:

meta http-equiv="X-UA-Compatible" content="IE=8"

I deleted this line and it worked. 我删除了这一行,它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM