There is the possibility that these messages can have double quotes and other escape characters.
I am using
parent.myForm.hiddenValue.value = encodeURIComponent(<xsl:value-of select="INCOMING/MESSAGE/BLAH">)
This works if the message has special characters but seems to give me a JS error if it does not.
If the value coming in, nature. It will give me the error, nature is undefined.
Any ideas on how to use encode for both scenarios?
maybe this ...
You'll need to encase the XSL tag in quotes:
And then you'll need to escape quote characters at the XSL layer. Better yet, the data within the XML should not have raw quote characters. They should all be encoded as [ampersand]quote;
parent.myForm.hiddenValue.value = "<xsl:value-of select="INCOMING/MESSAGE/BLAH">";