In order to do this i'm using the piece of code below;
Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Object()) Dim pageView As PageView = TryCast(args(0), PageView) pageView.AddJavascript("/Scripts/cookie-settings.js") Dim res = pageView.getJavascripts().Insert(0, "/Scripts/cookie-settings.js") pageView.Current.AddJavascript("/Scripts/cookie-settings.js") If Helper.CookieExists("cc_cat2") Then End If End Sub
The code executes, but I don't see any javascript being outputted to the headsection of the page. What is the correct way to do this? I've also tried adding an absolute path to the javascript instead of a relative one, but this doesn't work either.
I'm expecting something like this in the headsection;
<script src="/Scripts/cookie-settings.js" type="text/javascript"></script>