简体   繁体   English

Internet Explorer中的自动刷新HTML选项卡

[英]Auto-refresh HTML tab in internet explorer

I made a nice website that does a lot of DOM manipulation. 我做了一个不错的网站,可以进行很多DOM操作。 Works very nicely in chrome and firefox. 在chrome和firefox中效果很好。 Though the client has requested now that it also works in Internet Explorer. 尽管客户端现在要求它也可以在Internet Explorer中运行。 The latest version is good enough to start with (that would be 10.0.9200.16721 in my case). 最新版本足以作为开始(在我的情况下为10.0.9200.16721)。

So the adventure starts, i press F12 and see a set of pretty familiar developer tools (coming from chrome and firebug). 因此冒险开始了,我按F12键,然后看到一组相当熟悉的开发人员工具(来自chrome和firebug)。 As i'm tracking the JS code i notice that the HTML tab (with the DOM) doesn't actually update. 当我跟踪JS代码时,我注意到HTML选项卡(带有DOM)实际上并未更新。

According to the manual here http://msdn.microsoft.com/en-us/library/ie/gg589512(v=vs.85).aspx it's "a good idea to refresh the HTML tab to get the current DOM, especially when you use dynamic elements." 根据此处的手册http://msdn.microsoft.com/zh-cn/library/ie/gg589512(v=vs.85).aspx ,“刷新HTML标签以获取当前DOM是一个好主意,尤其是当您使用动态元素时。” (d0h ??) problem is .. i can't find a button to enable automatic update of the HTML tab. (d0h ??)问题是..我找不到启用自动更新HTML标签的按钮。 So i would have to click the refresh button everytime i step into a new line of JS (never mind of real-time DOM view). 因此,每当我进入JS的新行时,我都必须单击“刷新”按钮(不必担心实时DOM视图)。

But that's not all ... every time i click the refresh button the whole DOM tree view collapses. 但这还不是全部...每次我单击刷新按钮时,整个DOM树视图就会崩溃。 And i have to click a bunch of pluses to view the node i'm interested in. 而且我必须单击一些加号才能查看我感兴趣的节点。

Does anyone have a solution for this? 有人对此有解决方案吗? Because what would take days will take weeks this way... 因为要花几天的时间,这种方式要花几周的时间...

Duplicate of How to inspect elements on dynamically created DOM by using IE developers tools 如何使用IE开发人员工具检查如何在动态创建的DOM上检查元素

From doing a little digging aroung, it seems like this is an issue other people have reported too. 经过一番挖掘,似乎这也是其他人报告的一个问题。 This thread might be of some interest to you. 您可能对此线程感兴趣。

The most relevant part of it: 其中最相关的部分:

The problem is when you modify the dom (with or without jquery) from a callback which is called by a timeout, which is in a callback bound to an event, IE freaks out and doesn't update the dom tree in the development tool. 问题是,当您从超时(在绑定到事件的回调中)调用的回调中修改dom(带有或不带有jquery)时,IE会吓跑,并且不会在开发工具中更新dom树。 Subsequent modifications to the changed tag in the dev tool won't have any effect. 在dev工具中对更改后的标记进行的后续修改不会产生任何效果。

According to my tests, it's the combination of that sequence of calls that make this happen. 根据我的测试,正是这种调用顺序的组合才使这种情况发生。 If the dom is modified from a settimeout callback but without being inside of an event callback, it works. 如果从settimeout回调中修改了dom,但没有将其放入事件回调中,则它将起作用。 If instead of settimeout you directly call a function that modifies the dom, it works. 如果您直接调用修改dom的函数而不是settimeout,那么它将起作用。

Here 'sa working example of what you're saying to compound the issue. 是您要说的使这个问题复杂化的有效示例。

Basically, this is an issue with IE. 基本上,这是IE的问题。 There is no fix available at the moment. 目前没有可用的修复程序。 The accepted answer on the other thread seems like a very poor workaround. 在另一个线程上接受的答案似乎是一个非常差的解决方法。

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

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