I am including two JS files via DnnJsInclude like
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/aivestPortfolio/Scripts/aivest/PortfolioUtils.js" Priority="300" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/aivestPortfolio/Scripts/aivest/PortfolioStatistics.js" Priority="500" />
The second one is loading just fine and it is referencing the first file - which produces a Javascript error, since the first file is not loaded at all, the code is simply missing. I looked for the obvious (invalid path and the like), even tried renaming PortfolioUtils to no avail. When I use
<script src='<%=ResolveClientUrl("~/DesktopModules/aivestPortfolio/Scripts/aivest/PortfolioUtils.js") %>' type="text/javascript"></script>
instead, it works find (and in debug mode it works, too).
I think this must somehow be related to the actual JS code, is that possible? In PortfolioUtils.js:
var PortfolioUtils = function () {
return {
getDecimalSeparator: function () {
var n = 1.1;
n = n.toLocaleString().substring(1, 2);
return n;
},
[...]
}
}
and in PortfolioStatistics.js:
[...]
var portfolioStats = new PortfolioStatistic();
$(document).ready(function () {
portfolioStats.SetLoadingState(true);
portfolioStats.utils = new PortfolioUtils();
ko.applyBindings(portfolioStats);
});
Maybe there is a proper way of debugging DnnJsInclude, it looks rather black-boxy to me. I also fiddled around with the Priority and ForceProvider - no change.