contentflow autostart does not work in firefox
I have created a test carousel with conte开发者_Python百科ntflow
http://www.invest-champagne-ardenne.fr/test-carousel
Everything is fine except that the autostart does not work in firefox.
I have looked a solution for hours but i can't find the reason why it does not work.
Do you have any idea ? Thank you.
Web Console shows the following error:
this.AddOns[B] is undefined @ http://www.invest-champagne-ardenne.fr/design/cadevinstitutionnel/javascript/contentflow.js:37
This is coming from method setAddOnConf
which is apparently being called before the add-ons loaded. If you look at how the add-ons are being loaded:
addScript : function(B) {
if (this.Browser.IE || this.Browser.WebKit || this.Browser.Konqueror) {
document.write('<script type="text/javascript" src="' + B
+ '"><\/script>')
} else {
var A = document.createElement("script");
A.src = B;
A.setAttribute("type", "text/javascript");
document.getElementsByTagName("head")[0].appendChild(A)
}
},
And here we have a bug in contentflow.js
- this assumes that dynamically added scripts will load synchronously in all browsers but Internet Explorer and WebKit-based browsers. That's something that Firefox is no longer doing starting with Firefox 4 (see bug 591981 for more details). Simplest fix: remove the if
statement and do document.write()
for all browsers. The other option would be adding async="false"
attribute to the dynamically inserted script, I'm not sure however what the browser support matrix looks like here.
精彩评论