Javascript functions not identified by Firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rose Girl

    #1

    Javascript functions not identified by Firefox

    I have a web application that uses xsl and javascript which runs
    smoothly on IE. Recently i decided to try it on FireFox 1.0 . But the
    same application gives javascript errors as displayed in the console.
    What i found out is that FireFox doesnt recognize Javascript functions
    from a xsl page. Its ok from a html page.

    I have given a code of a xsl page. Can someone point what possibly
    could be the problem.

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:styleshe et version="1.0"
    xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/spider-xml">

    <html>
    <head>
    <script type="text/javascript"
    language="javas cript"><xsl:com ment><![CDATA[

    function validate(){
    alert("Help ! This function is not been called ...")
    }

    ]]></xsl:comment></script>

    </head>
    <body>
    <table>
    <tr>
    <td>
    <a href="#xx">
    <xsl:attribut e name="onClick"> validate();</xsl:attribute>
    Some link
    </a>
    </td>
    </tr>
    </table>
    </body>
    </html>

    </xsl:template>
    </xsl:stylesheet>


    Thankyou for your time.
    Regards
    Rose Girl.

  • Martin Honnen

    #2
    Re: Javascript functions not identified by Firefox



    Rose Girl wrote:
    [color=blue]
    > I have a web application that uses xsl and javascript which runs
    > smoothly on IE. Recently i decided to try it on FireFox 1.0 . But the
    > same application gives javascript errors as displayed in the console.
    > What i found out is that FireFox doesnt recognize Javascript functions
    > from a xsl page. Its ok from a html page.
    >
    > I have given a code of a xsl page. Can someone point what possibly
    > could be the problem.
    >
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <xsl:styleshe et version="1.0"
    > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">[/color]

    Add
    <xsl:output method="html" />
    here and
    [color=blue]
    > <xsl:template match="/spider-xml">
    >
    > <html>
    > <head>
    > <script type="text/javascript"
    > language="javas cript"><xsl:com ment><![CDATA[[/color]

    get rid of that comment e.g. simply use
    <script type="text/javascript"><![CDATA[
    ... script goes here ...
    ]]></script>
    then I think the function should be found.

    If you still have problems then with Firefox then please tell us the
    exact error message you get in the JavaScript console.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    Working...