2

Hello i'm facing this problem in a sharepoint 2016 on-prem environment. i customize my masterpage (starting from the seattle one) adding some custom javascript such as following...............

<SharePoint:ScriptLink Language="javscript" Name="~sitecollection/Style Library/BMS/jquery.js" LoadAfterUI="true" Defer="true" runat="server" Localizable="false" />
        <SharePoint:ScriptLink Language="javscript" Name="~sitecollection/Style Library/BMS/handlebars-v4.1.0.js" LoadAfterUI="true" Defer="true" runat="server" Localizable="false" />
        <SharePoint:ScriptLink Language="javscript" Name="~sitecollection/Style Library/BMS/Bootstrap/bootstrap.min.js" LoadAfterUI="true" Defer="true" runat="server" Localizable="false" />
        <SharePoint:ScriptLink Language="javscript" Name="~sitecollection/Style Library/BMS/Bootstrap/bootstrap-select.min.js" LoadAfterUI="true" Defer="true" runat="server" Localizable="false" />
        <SharePoint:ScriptLink Language="javscript" Name="~sitecollection/Style Library/BMS/popper.min.js" runat="server" Localizable="false" />
        <SharePoint:ScriptLink Language="javascript" Name="sp.runtime.js" runat="server" OnDemand="false" LoadAfterUI="true" Localizable="false" />
        <SharePoint:ScriptLink Language="javascript" Name="SP.Taxonomy.js" runat="server" OnDemand="false" LoadAfterUI="true" Localizable="false" />
        <SharePoint:ScriptLink Language="javascript" Name="~sitecollection/Style Library/BMS/Js/jquery.flagstrap.js" LoadAfterUI="true" Defer="true" runat="server" Localizable="false" />
        <SharePoint:ScriptLink Language="javascript" Name="~sitecollection/Style Library/BMS/Js/initFlagstrap.js" LoadAfterUI="true" Defer="true" runat="server" Localizable="false" />

what happens is that sometimes the pages break using internet explorer (hiding the sharepoint above bar and no longer running javascripts in the page).

the first exception that i get using IE developer tools is :

SCRIPT5007: Unable to get property 'toLowerCase' of undefined or null reference

in the file init.js (which is not custom).

strangely if i type "window.location" in the console i get the object that i can expand and notice that window.location.pathname DOES have a value but if I type "window.location.pathname" in the console i get a variable = undefined error.

i'm getting crazy with that, anyone has any clue? thanks!!!

Steve B
  • 36,818
  • 21
  • 101
  • 174

0 Answers0