How do I include remote stylesheets or JavaScripts in a widget?
How do I include remote stylesheets or JavaScripts in a widget?
Hi . The techniques for including remote scripts are identical to local.
For CSS, you can add a <link> element referencing the stylesheet as follows:
$core_v2_page.AddLink('stylesheet', $styleSheetUrl, "%{ Position = 'AfterTheme' }")
For JavaScript, you can just render a <script> tag directly, or if you prefer, use the #registerEndOfPageHtml directive.
#registerEndOfPageHtml() <script src="$core_v2_encoding.HtmlAttributeEncode($javaScriptUrl)"></script> #end