gpt4 book ai didi

javascript - 在 Extjs 的外部 html 中使用脚本

转载 作者:行者123 更新时间:2023-11-28 01:30:20 25 4
gpt4 key购买 nike

我在 Extjs 的面板中有一个外部 html。但是在我的 html 中用脚本标签定义的脚本没有被加载;因此我的 html 无法正常工作。

var test = Ext.create('Ext.panel.Panel', {
title : 'Example 1',
width : 250,
height : 250,
frame : true,
scripts: true,
autoLoad : {
url : './test.html'
}
})

到目前为止我已经尝试过:

前两个将我的脚本加载到 Extjs(我可以在 firebug 中看到它)但我的 html 文件仍然无法访问它。

因此;

有哪些(可行的)替代方案可以让它发挥作用?

最佳答案

autoLoad配置已弃用。使用 loader相反。

var test = Ext.create('Ext.panel.Panel', {
title : 'Example 1',
width : 250,
height : 250,
frame : true,
loader: {
url: './test.html',
autoLoad: true,
scripts: true
}
});

关于javascript - 在 Extjs 的外部 html 中使用脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30486023/

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