Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Subscribe and Support WebmasterWorld
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
httpwebwitch msg:3916717 7:52 pm on May 19, 2009 (gmt 0)
There are many possible ways to do this. here's one:
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" /> <xsl:text>';</xsl:text> </script>
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!
cjcj1 msg:3917121 1:00 pm on May 20, 2009 (gmt 0)
kaidok msg:3917356 7:43 pm on May 20, 2009 (gmt 0)
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:
alert(myvariable); </script> cjcj1 msg:3917809 2:20 pm on May 21, 2009 (gmt 0)