Created
October 10, 2014 08:40
-
-
Save contensis/8447eefd65620e6b1522 to your computer and use it in GitHub Desktop.
Working with JavaScript Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' If the same URL is registered twice it will only output one reference. | |
' The URL is used as a key to prevent duplicates. | |
' Add a JavaScript file before the opening body tag | |
CurrentContext.Page.Scripts.Add("app.js") | |
' Add a JavaScript file before the closing body tag | |
CurrentContext.Page.Scripts.Add("app.js", ScriptLocation.BodyEnd) | |
' Add a JavaScript file before the opening body tag | |
CurrentContext.Page.Scripts.Add("app.js", ScriptLocation.BodyStart) | |
' Add an inline JavaScript file before the closing body tag | |
CurrentContext.Page.Scripts.AddInline("alert('Hello World!');") | |
' Add an inline JavaScript file before the closing body tag | |
CurrentContext.Page.Scripts.AddInline("alert('Hello World!');", ScriptLocation.BodyEnd) | |
' Add an inline JavaScript file after the opening body tag | |
CurrentContext.Page.Scripts.AddInline("alert('Hello World!');", ScriptLocation.BodyStart) | |
' Remove a JavaScript file reference from the page | |
CurrentContext.Page.Scripts.Remove("app.js") | |
' Register jQuery for use on the page | |
CurrentContext.Page.Scripts.RegisterJQuery | |
' Register Contensis Web API for use on the page | |
CurrentContext.Page.Scripts.RegisterContensisApi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment