'Load JQuery from DNN in 2sxc13
Is there a way to load JQuery library from the DNN install in a razor template without loading external links or relative paths to the file? Something like @include(jquery). Even better if it checks if it is already loaded.
Solution 1:[1]
This can be done in 2sxc ;)
var page = GetService<ToSic.Sxc.Services.IPageService>();
page.Activate("jQuery");
See also https://docs.2sxc.org/net-code/razor/services/page-service-activate.html
Solution 2:[2]
If your skin/theme loads query you already have it. Check the available snippets and/or check the included apps to see how the 2sic folks do it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | iJungleBoy |
| Solution 2 | Joe Craig |
