2019-04-11, 22:55:59
(2019-04-11, 19:33:33)datiswous Wrote: Hello, why is the following code present on every page in the frontend? This is after the </footer>
(I made some of the urls shorter)Code:<!-- Responsive FileManager Javascripts loading ver. 2.5 -->
<script>
function loadjscssfile(filename, filetype){
if (filetype=="js"){ //if filename is a external JavaScript file
var fileref=document.createElement('script');
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", filename);
fileref.async = false;
}
else if (filetype=="css"){ //if filename is an external CSS file
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", filename);
}
if (typeof fileref!="undefined") {
document.body.appendChild(fileref);
}
}
if (window.addEventListener)
window.addEventListener("load", loadjscssfile, false);
else if (window.attachEvent)
window.attachEvent("onload", loadjscssfile);
else window.onload = loadjscssfile;
if (document.querySelector('.prettyPhoto') !== null) {
loadjscssfile(".../plugins/responsivefilemanager/css/prettyPhoto.css", "css");
loadjscssfile(".../plugins/responsivefilemanager/js/prettyPhoto/jquery.prettyPhoto.js", "js");
loadjscssfile(".../plugins/responsivefilemanager/js/prettyPhoto/rfm_prettyphoto.js", "js");
}
if (document.querySelector('.fancybox') !== null) {
loadjscssfile(".../plugins/responsivefilemanager/js/FancyBox/jquery.fancybox.css", "css");
loadjscssfile(".../plugins/responsivefilemanager/js/FancyBox/jquery.fancybox.pack.js", "js");
loadjscssfile(".../plugins/responsivefilemanager/js/FancyBox/rfm_fancybox.js", "js");
}
if (document.querySelector('.baguettebox') !== null) {
loadjscssfile(".../plugins/responsivefilemanager/js/BaguetteBox/baguetteBox.min.css", "css");
loadjscssfile(".../plugins/responsivefilemanager/js/BaguetteBox/baguetteBox.min.js", "js");
window.onload = function() {
baguetteBox.run('.baguettebox', {
// Custom options
fullScreen: false,
animation: 'fadeIn',
buttons: true,
overlayBackgroundColor: 'rgba (0,0,0,.8)',
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}
});
};
}
</script>
Might this be related to a previous post from Shawn about loading css?
Hello.
Initially I use absolute path to all JS and CSS sources for best compatibility.
But you can use relative path if it works good on your server.
And do not forget add code for Jquery script loading because it required for prettyPhoto and Fancybox.
On your code example this part not included.