简体   繁体   English

Internet Explorer 11 JavaScript:对象是静态的

[英]Internet explorer 11 javascript : Object are static

Using the interactive console in IE11 (F12), I have static object 使用IE11(F12)中的交互式控制台,我有静态对象

user=> a={a:5,b:6}
  [object Object] { a : 5 , b : 6 }
user=> a.l=6
  object does not support this property 

The first line of the Console says : 控制台的第一行显示:

The attached page targets document mode 5. Some console APIs and features may not be available.

Yes, indeed, some API are not accessible! 是的,确实,某些API无法访问!

How can I get dynamic object with javascript in IE11? 如何在IE11中使用JavaScript获取动态对象?

You've set your document mode to 5 (Internet Explorer 5), change it back to 11: 您已将文档模式设置为5(Internet Explorer 5),将其更改回11:

在此处输入图片说明

In my case, the document was a document in a frame windows. 就我而言,该文档是框架窗口中的文档。

So, I added the following line in the header of the html document that countains the frameset tag. 因此,我在html文档的header中添加了以下行,该行包含了frameset标签。

<meta http-equiv="X-UA-Compatible" content="IE=10" />

Then the message did not appears again. 然后,该消息不再出现。 It seems that the problem was solved and that attribute can be added dynamically as in the w3c norm. 看来问题已解决,并且可以像w3c规范中那样动态添加属性。

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

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