-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmailto.js
More file actions
28 lines (24 loc) · 970 Bytes
/
Copy pathmailto.js
File metadata and controls
28 lines (24 loc) · 970 Bytes
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
/** @Name Mailto Concealer
** @URI http://www.pxoink.net/
** @Author PxO Ink
** @AuthorURI http://www.pxoink.net/
** @License Creative Commons Attribution-NoDerivs 3.0 Unported License
** @Copyright © 2013 PxO Ink. Some Rights Reserved.
**/
//Mailto function.
function cmailto(id, domain, handle, tld, subject, content) {
//Declare variables.
var a = '<' + String.fromCharCode(97,32,104) + 'ref="mailto:';
var b = '">';
var c = '</' + String.fromCharCode(97) + '>';
var content = (!content) ? handle + '@' + domain + '.' + tld : content;
//String building.
var string = a + handle + '@' + domain + '.' + tld + '?subject=' + subject + b + content + c;
//Set a timer to inject content.
setTimeout(function() {
//Write to the document.
document.getElementById(id).innerHTML = string;
}, 850);
}
//Launch the mailto.
cmailto('email', 'example', 'me', 'com', 'I%20Would%20Like%20to%20Hire%20You!', 'Contact Us');