gpt4 book ai didi

javascript - Uncaught Error : DOM element with id x in Element cache is not same as element in DOM

转载 作者:行者123 更新时间:2023-11-30 16:05:08 36 4
gpt4 key购买 nike

我在 UI 中的按钮 Click 事件上有以下代码,它返回一个 MS-Excel 文件。它在第一次点击事件中完美运行,但之后返回以下错误。

任何建议,我怎样才能摆脱它?

ERROR: Uncaught Error: DOM element with id iframe in Element cache is not the same as element in the DOM. Make sure to clean up Element instances using destroy()

{
var body = Ext.getBody();
var frame = body.createChild({
tag:'iframe'
,cls:'x-hidden'
,id:'iframe'
,name:'iframe'
});

var form = body.createChild({
tag:'form'
,cls:'x-hidden'
,id:'form'
,params: cloneExportObject
,method: 'post'
,action:link
,target:'iframe'
,enctype: 'application/x-www-form-urlencoded'
,encoding: 'application/x-www-form-urlencoded'
});

var hiddenItem1 = document.createElement('input');
Ext.fly(hiddenItem1).set({
type: 'hidden',
value: cloneExportObject.securityId,
name: 'securityId'
});
form.appendChild(hiddenItem1);

var hiddenItem2 = document.createElement('input');
Ext.fly(hiddenItem2).set({
type: 'hidden',
value: cloneExportObject.uniqueSearchId,
name: 'uniqueSearchId'
});
form.appendChild(hiddenItem2);

form.dom.submit();
}

最佳答案

if(Ext.Element.cache.hasOwnProperty(domId)){
Ext.Element.cache[domId].destroy();
}

var domElement = Ext.get(domId);

关于javascript - Uncaught Error : DOM element with id x in Element cache is not same as element in DOM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37148982/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com