Call a code on click ?? (I think)

W

Wayne-I-M

Hi

I got this code from a post from Don (9/28/2004 9:32 AM PST) in this group.
I have been trying to get it to work - but can't :-(

Is it like an access module - do I call it from an OnClick event?

Does it go in the head or the body. I know this will be really simple for a
frontpage expert (which I am "not")

Thank you for your help


<script language=javascript>
<!--
var username = "wayne";
var hostname = "some_domain.com";
var linktext = "Click Here To Send Me a Email";
document.write("<a href=" + "mai" + "lto:" + username + "@" + hostname +
">"
+ linktext + "</a>")
//-->
</script>
 
A

Andrew Murray

No, all this script is doing is "fudging" your email address so it can't be
picked up by spammers.

You just insert the entire script, in the <body> section of your Code (turn
to Code View in FP) and paste it to the point where you want the email
address to appear.

Then preview the page (in Browser rather than FP Preview).

You will see it comes up like a normal mailto email link. but if you then
go Right click View Source, you will see the javascript code instead of the
standard mailto a href link.

You don't need to "onclick" or "onLoad" this one, it just runs when you view
the normal HTML page.

Andrew.
 
R

Ronx

Its client side JavaScript.

You place it in the body of the page (in code view) where you want a
mailto: link to show.

Example:

<body>
<p> loads of page thingummies here </p>

<p>
<script language=javascript>
<!--
var username = "wayne";
var hostname = "example.com";
var linktext = "Click Here To Send Me a Email";
document.write("<a href=" + "mai" + "lto:" + username + "@" + hostname +
">"
+ linktext + "</a>")
//-->
</script>
</p>

<p> rest of page </p>

</body>


The link will only appear if JavaScript is enabled on the browser.
 
W

Wayne-I-M

Thank you

--
Wayne
Manchester, England.



Ronx said:
Its client side JavaScript.

You place it in the body of the page (in code view) where you want a
mailto: link to show.

Example:

<body>
<p> loads of page thingummies here </p>

<p>
<script language=javascript>
<!--
var username = "wayne";
var hostname = "example.com";
var linktext = "Click Here To Send Me a Email";
document.write("<a href=" + "mai" + "lto:" + username + "@" + hostname +
">"
+ linktext + "</a>")
//-->
</script>
</p>

<p> rest of page </p>

</body>


The link will only appear if JavaScript is enabled on the browser.

--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp
 
W

Wayne-I-M

Thank you

--
Wayne
Manchester, England.



Andrew Murray said:
No, all this script is doing is "fudging" your email address so it can't be
picked up by spammers.

You just insert the entire script, in the <body> section of your Code (turn
to Code View in FP) and paste it to the point where you want the email
address to appear.

Then preview the page (in Browser rather than FP Preview).

You will see it comes up like a normal mailto email link. but if you then
go Right click View Source, you will see the javascript code instead of the
standard mailto a href link.

You don't need to "onclick" or "onLoad" this one, it just runs when you view
the normal HTML page.

Andrew.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top