Connecting Tech Pros Worldwide Help | Site Map

how to replace text on a page using Javascript code

  #1  
Old July 23rd, 2005, 08:51 PM
Tony Strazzeri
Guest
 
Posts: n/a
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="visibility: hidden">mailAddyFor:
'Address_for_Info' </span>
<script language="javascript"
type="text/javascript">generate_address('Address_for_Info')</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_for_Inf o@domain.com"
Note: the "_" are actually spaces.

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

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

Cheers
TonyS.

  #2  
Old July 23rd, 2005, 08:51 PM
Duncan Booth
Guest
 
Posts: n/a

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 programmatically
> (say from within the code that creates the address)?
>[/color]
Setting its style to display:none should be good enough for what you want.
  #3  
Old July 23rd, 2005, 08:54 PM
Tony Strazzeri
Guest
 
Posts: n/a

re: how to replace text on a page using Javascript code


Thank you. That works a treat!

Cheers
TonyS.

  #4  
Old July 23rd, 2005, 09:00 PM
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a

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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem facing while Dynamic Image Creation to replace Font Embedding neovantage answers 1 April 10th, 2009 08:34 PM
Need help deciphering this string using javascript code jbowers answers 2 April 27th, 2007 06:45 AM
Server Side include to replace text Casey answers 5 February 7th, 2006 07:55 PM
replace instances of text on page with image or other text? juglesh answers 16 July 23rd, 2005 05:15 PM