Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Wachter Bernd 48 posts 68 karma points
    Oct 25, 2009 @ 11:08
    Wachter Bernd
    0

    Insert Javascrip in xls

    Hello ,

    I will make a Macro xsl with insert this Javasript to
    Decode Email Adresses

     

    <script language="JavaScript"><!--
        var name = "protected";
        var domain = "domain.de";

    document.write('<a href=\"mailto:' + name + '@' + domain + '\">');

    document.write(name + '@' + domain + '</a>');
    // --></script>

    I will ma Macro to insert in my Ritsch Text Editor to load the JAvasript
    where will insert a Decode Email Adress evereyone one a Page ????

     

     

  • dandrayne 1138 posts 2262 karma points
    Oct 25, 2009 @ 18:32
    dandrayne
    2

    Hi there

    If you'd like to know about using js inside xslt, try this thread -> http://our.umbraco.org/forum/developers/xslt/4845-script-in-umbraco-pages

    Dan

  • Wachter Bernd 48 posts 68 karma points
    Oct 26, 2009 @ 07:34
    Wachter Bernd
    0

    Hi,

    When i insert this code in my xls Macro
    and insert the Macro in my RitchTextEditor into a Page

    ----------------------------------------------------------------------------------------------
    <script language="JavaScript">
    <![CDATA[
        var name = "protected";
        var domain = "domain.de";

    document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
    document.write(name + '@' + domain + '</a>');
    ]]>
    </script>
    ---------------------------------------------------------------------------------------------

    I become this Output on my Site:
    <a href="mailto:[email protected]">[email protected]</a>

    and not the Email Adress Link where work ????
    In my Source Code i see this Line:

    document.write('&lt;a href=\"mailto:' + name + '@' + domain + '\"&gt;');

     

    my "<" are deleted by Umbraco ??????

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 26, 2009 @ 08:38
    Jan Skovgaard
    0

    Is there a particular reason that you want to insert the macro into the rich text editor? Isn't it possible for you to place it in your master template for instance?

    I'm not sure but I think that tidy might remove some characthers.

    /Jan

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Oct 26, 2009 @ 10:05
    Chriztian Steinmeier
    2

    Hi Wachter - your '<' are just being escaped - you should be able to fix it though, using the <xsl:text> instruction with the disable-output-escaping attribute:

    <script type="text/javascript">
        <xsl:text disable-output-escaping="yes"><![CDATA[
        var name = "protected";
        var domain = "domain.de";
        document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
        document.write(name + '@' + domain + '</a>');]]></xsl:text>
    </script>
    
    /Chriztian
  • Wachter Bernd 48 posts 68 karma points
    Oct 26, 2009 @ 10:42
    Wachter Bernd
    0

    Hi Chriztian,

    Thanks yes it works now !!!


    Jan:
    Yes is correct does i must insert the Macro in a Editor and not in the Template...
    My User must insert your encoded Email Adress by self on any Place in the Homepage !

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft