I am using the Galleria slideshow on my site, but I've noticed an error that seems to happen very randomly. Most of the time the slideshow loads correctrly but once in a while I get this error:
Uncaught Error: Fatal error: Theme at javascript/themes/classic/galleria.classic.js
could not load, check theme path.
When I reload the page, it's all back to normal. This is the code I'm using to load it:
<script>
// Load the classic theme
Galleria.loadTheme('javascript/themes/classic/galleria.classic.js');
</script>
I have searched around but still haven't found a solution that works. My personal idea was to have a script that keeps loading until it succeeds, since on reload the page works. How would I do this?
1 Try the latest build at gihub: https://github.com/aino/galleria/blob/master/src/galleria.js
2 Try loading the theme using a script tag instead:
<script src="javascript/themes/classic/galleria.classic.js"></script>
I adopted the method pointed out by David, loading the theme using a script tag:
<script src="javascript/themes/classic/galleria.classic.js"></script>
But was eventually getting another error (Fatal error: Theme CSS could not load after 20 sec). I'd also recommend adding the CSS using a link tag:
<link rel="stylesheet" type="text/css" href="galleria/themes/classic/galleria.classic.css" />
I had a similar message today when I tried using Galleria. It happened only in Firefox. What I did to get around it is to add the theme stylesheet link directly in the head
. I kept the theme script link in too, after the stylesheet, just in case it was needed. After that, the error message went away and Galleria is working as it should.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With