Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: open
Just to play around I also hardcoded the path in the Js file but the only way I could access the image was by something like this ../image and not with an absolute path like c:/output/image or c:\output\image
In your XSL, you can create a <script> element and define a global variable in it.
[the following goes in your XSL, preferably inside the <head> or early in the <body>]
<xsl:text>window.myvariable = '</xsl:text>
<xsl:value-of select="xpath-to-your-image-name" />
Another way would be to create an XML "Island" in the DOM, and parse data out of that
I'd go for the first method; it's easiest.
Good luck cjcj1!
In the example above, your value is stored in a variable called "window.myvariable". Since "window" is the default root global scope, you can just use "myvariable", like this: