Requirements
Resources
Activate turnOn and execute basic tasks
This page activates turnOn and executes a JavaScript function using turnOn.
In this tutorial you'll learn how to:
- Activate turnOn using the PageService
- Execute a JavaScript function on initial loading
Output
turnOn is waiting - this will be replaced within 3 seconds... đŸ˜”
Source Code of this file
Below you'll see the source code of the file. Note that we're just showing the main part, and hiding some parts of the file which are not relevant for understanding the essentials. Click to expand the code
@using ToSic.Razor.Blade; @inherits Custom.Hybrid.Razor14 <!-- unimportant stuff, hidden --> <div @Sys.PageParts.InfoWrapper()> @Html.Partial("../shared/DefaultInfoSection.cshtml") <div @Sys.PageParts.InfoIntro()> <h2>Activate turnOn and execute basic tasks</h2> <div>This page activates turnOn and executes a JavaScript function using turnOn.</div> <br> In this tutorial you'll learn how to: <ul> <li> Activate turnOn using the PageService </li> <li> Execute a JavaScript function on initial loading </li> </ul> Look at the text below to see the effect. </div> </div> <div id="turn-on-example"> turnOn is waiting - this will be replaced within 3 seconds... 😔 </div> @* Executes the JavaScript function window.turnOnTutorial100.init() from the included script file *@ @Kit.Page.TurnOn("window.turnOnTutorial100.init()") <script src="@CmsContext.View.Path/100-local-js.js" @Kit.Page.AssetAttributes()></script> @* Footer *@ @Html.Partial("../Shared/Layout/FooterWithSource.cshtml", new { Sys = Sys })