Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ivan 165 posts 543 karma points
    Feb 08, 2013 @ 07:27
    Ivan
    0

    RegisterJavaScriptFile in XSLT. How?

    Hi guys.

    How do I register a JS file from within an XSLT template.

    I know, it's possible to do from within .cshtml scripts like: 

    @library.RegisterJavaScriptFile("myScripts", "/scripts/myScript.js");

    But how about XSLT?

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 9x admin c-trib
    Feb 08, 2013 @ 08:13
    Chriztian Steinmeier
    100

    Hi Ivan,

    You can do almost exactly the same: http://our.umbraco.org/wiki/reference/umbracolibrary/registerjavascriptfile

    Though it's quite a bit of a hack in XSLT, given that you need to set a variable to nothing to be able to call the extension.

    But you can do it if it's the only place it makes sense to do so.

    /Chriztian 

  • Ivan 165 posts 543 karma points
    Feb 08, 2013 @ 11:52
    Ivan
    0

    Hi Chriztian.

    Thanks! That's just what I need.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies