Forum Moderators: not2easy

Message Too Old, No Replies

split up an email addy and position the pieces?

         

nancyb

10:43 pm on Sep 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This may be the most hair brained idea I've ever had, so knowing that I already suspect that, please don't pitch rotten tomatoes :)

Would it be possible to keep the email harvesters at bay by using CSS to reposition snippets of encoded email addresses in one place?

I haven't learned how to position things yet, but if this is possible, it may be the bump in the bum that I need to get started.

TGecho

11:41 pm on Sep 13, 2003 (gmt 0)

10+ Year Member



That would work from a visual perspective. But you wouldn't be able to make a mailto link and I think screen readers would have problems.
Also, I wouldn't be able to highlight the address to copy/paste

Ryan8720

12:10 am on Sep 14, 2003 (gmt 0)

10+ Year Member



Short answer: no
Long answer: you can come close, but even if you did accomplish it, it wouldn't be cross-browser compatible.

However, you can use JavaScript to do it.

<script type="text/javascript">
<!--
var name = "yourname";
var domain = "host.com";
var subject = "This%20is%20the%20subject";
document.write('<a href=\"mailto:' + name + '@' + domain + '?subject=' + subject + '\">');
document.write(name + '@' + domain + '</a>');
// -->
</script>

You can just leave the subject blank if you don't want one. or use this:

<script type="text/javascript">
<!--
var name = "yourname";
var domain = "host.com";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');
// -->
</script>

nancyb

12:24 am on Sep 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks TGecho & Ryan8720,

I thought it was probably a no go :(

But, why can't the bots pull the var name and var domain from the .js file? Is this just another stupid question?

Shadows Papa

4:03 pm on Sep 14, 2003 (gmt 0)

10+ Year Member



Because how will they know the variable names?
You can use ANYTHING as the name of the variable.
For example, in place of "name", use "eman"
and in place of domain use niamod. how would it know what was what? It wouldn't.
You can split the domain up even more - use a 3rd variable.
Name
domain1
domain2
where name = the first part of your email address
domain1 = aol (for example)
and domain2 = .com (or just com and put the period in as non-variable)

I use it and can say it works great. In the sample below, where you see the words name and domain, use any word you wish, as long as you replace it in the WHOLE script.

<script language="JavaScript"><!--
var name = "hername";
var domain = "herdomain.com";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');
// --></script>

You coule even use an include statement and put the file included in a hidden, but that's less safe and it would present the whole thing without running a script

Shadows Papa