-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmailto.js
executable file
·52 lines (47 loc) · 1.25 KB
/
mailto.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// mailto.js
//
// Original idea from http://innerpeace.org/escrambler.shtml
//
// Scramble your email address from SPAM Email Crawlers.
//
//
// Add the following to the <head> section of a HTML page:
//
// <script language="JavaScript1.1" src="/Lib/mailto.js"></script>
//
// For every place you use the URL "mailto:[email protected]",
// replace the URL with:
//
// javascript:mailto()
//
// To support multiple email addresses, just copy/paste the function
// below once for each address, rename the function, and specify the
// account name and host name variables.
//
// The scrambling comes two fold: first, the JavaScript is in a
// separate file which probably won't be fetched; second, the email
// is address broken up into pieces.
//
// Works in IE 4, 5, 6 and Netscape 4.7, 6.
//
function mailto(here)
{
here = here.replace(/\s+at\s+/, '@');
here = here.replace(/\s+dot\s+/g, '.');
location.href = "mailto:" + here;
}
function achowe()
{
mailto('achowe at snert dot com');
}
function modules()
{
mailto('modules at snert dot com');
}
function modulesRequest(subject)
{
var account = "modules-request";
var host = "snert.com";
location.href = "mailto:" + account + "@" + host + "?subject=" + subject;
}