wordpress hit counter
Welcome to OpenXML Developer Sign in | Join | Help

get the browser version using XSLT and java script

Last post 04-15-2010, 11:35 PM by Intergen. 1 replies.
Sort Posts: Previous Next
  •  11-08-2008, 12:04 PM 3851

    get the browser version using XSLT and java script

    Hi,
    I want to embed some javascript code into the XSLT transformation, which detects the user's browser.
    The code i wrote is shown below:

     <msxsl:script language="JavaScript" implements-prefix="user">
        <![CDATA[
        function getBrowser() {
           return navigator.appName;
        }
        ]]>
      </msxsl:script>

    But when the style sheet is used in the transformation, it says that the variable 'navigator' is not declared. but 'navigator' is a key javascript object.
    Can somebody explain why this is so?

    Best Regards,
    suralk
  •  04-15-2010, 11:35 PM 8484 in reply to 3851

    Re: get the browser version using XSLT and java script

    Hi there

    Try output a message, alert("something") to debug first.
View as RSS news feed in XML