how to replace text on a page using Javascript code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Strazzeri

    how to replace text on a page using Javascript code

    Hi,

    I recently posted "problem with Javascript code from Include"
    Thanks to response I have now fixed the problem.

    This is to ask how to solve my next problem/step.

    I am using javascript to create my email address on the fly so as to
    avoid SPAM harvesters.

    I like to see where I have placed the email address during design time.
    What I am doing now is setting the marker text as hidden so it appears
    at design time but is invisible at run time.

    I use this code to display the spot followed by the call to create the
    address.
    Send Email to: <span style="visibili ty: hidden">mailAdd yFor:
    'Address_for_In fo' </span>
    <script language="javas cript"
    type="text/javascript">gen erate_address(' Address_for_Inf o')</script>

    The problem with this is that even though the marker is set to
    invisible it still holds space and forces the address to appear away
    from the label "Send Email to: ".

    It appears as;
    "Send Email
    to:____________ _______________ _____Address_fo r_Info@domain.c om"
    Note: the "_" are actually spaces.

    Instead of; "Send Email to: Address_for_Inf o@domain.com"

    Is there a way I can remove the entire marker text programmaticall y
    (say from within the code that creates the address)?

    Cheers
    TonyS.

  • Duncan Booth

    #2
    Re: how to replace text on a page using Javascript code

    Tony Strazzeri wrote:[color=blue]
    >
    > Is there a way I can remove the entire marker text programmaticall y
    > (say from within the code that creates the address)?
    >[/color]
    Setting its style to display:none should be good enough for what you want.

    Comment

    • Tony Strazzeri

      #3
      Re: how to replace text on a page using Javascript code

      Thank you. That works a treat!

      Cheers
      TonyS.

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: how to replace text on a page using Javascript code

        Tony Strazzeri wrote:
        [color=blue]
        > Thank you. That works a treat![/color]

        No, it does not.


        PointedEars

        Comment

        Working...