0

Can I write Javascript code in XSLT?

Basically I will be calling Javascript's document.location.href to check which site is currently opened (English or Arabic). So let's say if English site is opened, I want to perform some operation in XSLT and if Arabic then I want to perform some different operation.

    1 Answer 1

    2

    As I understand it, XSL is server-side and JS is client-side so you are trying to mix two incompatible layers. What you can do is include a reference to a JS script within your XSL which will then run against the rendered output.

    In the example you mention, you could potentially render both language versions using your XSL and then hide whichever you prefer using your JS?

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.