简体   繁体   English

如何重置Flex HTML控件的历史记录

[英]How to reset the Flex HTML control's history

I am using the flex HTML component and I would like to clear the history of the control when it is taken off screen, so that when it comes back on again the history is reset. 我正在使用flex HTML组件,并且要清除离开屏幕的控件的历史记录,以便再次打开该控件时,可以重置历史记录。

The only thing I can think of at the moment is to set the HTML control to a new HTML control, although this is a bit of a pain. 我目前唯一能想到的就是将HTML控件设置为新的HTML控件,尽管这有点麻烦。

Thanks 谢谢

The HTML control has a property named historyLength and historyPosition properties. HTML控件具有名为historyLength和historyPosition属性的属性。 Both allude to fact that the HTML content has a window history. 两者都暗示HTML内容具有窗口历史记录。

I bet you can use the domWindow property to get, and empty the history object. 我敢打赌,您可以使用domWindow属性来获取并清空历史记录对象。

htmlObject.domWindow.window.history 

More info on the history object here . 有关历史记录对象的更多信息,请参见此处 Nothing says it is read only, so I bet: 没有什么说是只读的,所以我打赌:

htmlObject.domWindow.window.history = new Array();

But I'm half guessing; 但是我半信半疑。 I didn't try this code. 我没有尝试此代码。

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

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