odl*_*dle 11 javascript reload galleria
我在我的网站上使用Galleria幻灯片,但我注意到一个似乎非常随机的错误.大多数情况下,幻灯片显示正确加载,但有一段时间我得到此错误:
Uncaught Error: Fatal error: Theme at javascript/themes/classic/galleria.classic.js
could not load, check theme path.
Run Code Online (Sandbox Code Playgroud)
当我重新加载页面时,它都恢复正常.这是我用来加载它的代码:
<script>
// Load the classic theme
Galleria.loadTheme('javascript/themes/classic/galleria.classic.js');
</script>
Run Code Online (Sandbox Code Playgroud)
我已经四处搜索,但仍未找到有效的解决方案.我个人的想法是有一个脚本继续加载,直到成功,因为重新加载页面工作.我该怎么做?
Dav*_*ing 13
1在gihub上尝试最新版本:https://github.com/aino/galleria/blob/master/src/galleria.js
2尝试使用脚本标记加载主题:
<script src="javascript/themes/classic/galleria.classic.js"></script>
Run Code Online (Sandbox Code Playgroud)