Hi There,
I get a 'Fancybox is already initialized' error in the browser console. I am using Fancybox 3.
The theme i am using, includes the JS in the following way:
<dnn:DnnJsInclude runat="server" FilePath="js/jquery.fancybox3.min.js" PathNameAlias="SkinPath" />
I am adding this same script in my custom module using the script manager.
scriptInclude = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
scriptInclude.Attributes["type"] = "text/javascript";
scriptInclude.Attributes["src"] = this.TemplateSourceDirectory + "/Scripts/jquery.fancybox.min.js";
scriptInclude.ID = ID + "_6";
Page.Header.Controls.Add(scriptInclude);
Is there a way that I can check in my module if the fancybox.js file is already included on the page? I know the Script Manager can prevent duplicate files being loaded, but what if the JS file is included in the Skin using the <dnn:DnnJsInclude....... method and not the Script Manager?
So, I would like to write code which prevents either my module or the theme to add the JavaScript file only once.