window.onLoad 中未定义 PF
PF not defined in window.onLoad
如果我使用 Primefaces (6.2.3) 执行以下 javascript - 但有时我在 firefox 中出现错误(在其他浏览器中没有):
TypeError: PF(...) is undefined
$(window).on('load', function() {
init();
});
function init() {
PF('selectOneMenuWidgetVar').selectValue("myvalue");
}
PF 定义在 core.js of primefaces 中。为什么 PF 在某些情况下在 firefox (52.8.0) 中可能是未定义的?有什么好的方法可以确保之前加载过吗?我以为所有的资源都应该加载过?
将init方法的调用移至页面末尾成功!
如果我使用 Primefaces (6.2.3) 执行以下 javascript - 但有时我在 firefox 中出现错误(在其他浏览器中没有):
TypeError: PF(...) is undefined
$(window).on('load', function() {
init();
});
function init() {
PF('selectOneMenuWidgetVar').selectValue("myvalue");
}
PF 定义在 core.js of primefaces 中。为什么 PF 在某些情况下在 firefox (52.8.0) 中可能是未定义的?有什么好的方法可以确保之前加载过吗?我以为所有的资源都应该加载过?
将init方法的调用移至页面末尾成功!