iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-16-2008, 12:56 PM
WebProWorld New Member
 
Join Date: Feb 2005
Location: UK
Posts: 11
surfing-mtber RepRank 0
Default Javascript email link with body text - How to?

Can anyone please advise.

Have been disguising email addresses on my web pages for some time now (to foil the spammers), using javascript, and would like to include in the body text of the resulting email some brief guidelines. Customers continue to mis-use the email to ask for advice which we do not provide, despite warnings on the pages!!

Any ideas?
Thanks

Last edited by surfing-mtber; 06-16-2008 at 01:33 PM.
Reply With Quote
  #2 (permalink)  
Old 06-16-2008, 02:32 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,657
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Javascript email link with body text - How to?

I think the following would work:

Code:
mailto:you@yourdomain.tld?body=your%20message%20here
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #3 (permalink)  
Old 06-16-2008, 02:43 PM
WebProWorld New Member
 
Join Date: Feb 2005
Location: UK
Posts: 11
surfing-mtber RepRank 0
Default Re: Javascript email link with body text - How to?

Thanks for the reply,
can't think where to place this in the javascript, here's what I am using:

<script language="JavaScript" type="text/javascript">
<!--
var name = "info";
var domain = "antique-prints.co.uk";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');

// -->
</script>
Reply With Quote
  #4 (permalink)  
Old 06-16-2008, 04:30 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,657
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Javascript email link with body text - How to?

I would do it as follows:
Code:
 <script language="JavaScript" type="text/javascript">
<!--
var name = "info";
var domain = "antique-prints.co.uk";
document.write('<a href=\"mailto:' + name + '@' + domain + '?body=Your%20message%20here\">');
document.write(name + '@' + domain + '</a>');

// -->
</script>
Just make sure you URL encode the message you put in the box and I think it will work.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #5 (permalink)  
Old 06-17-2008, 01:56 PM
WebProWorld New Member
 
Join Date: Feb 2005
Location: UK
Posts: 11
surfing-mtber RepRank 0
Default Re: Javascript email link with body text - How to?

Good advice, thank you very much.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email (not address, but email body) publishing ADAM Web Design Internet Industry 1 08-23-2007 11:05 PM
Javascript email help required!!! optimalwebsite Web Programming Discussion Forum 3 08-03-2007 01:07 PM
Technique for Pushing Body Text up the HTML code Ladder... bigdog97 Web Programming Discussion Forum 5 03-09-2005 04:01 PM
Body Text scouser Graphics & Design Discussion Forum 2 09-08-2004 03:53 AM
Defining body text northernladuk Graphics & Design Discussion Forum 2 08-11-2004 04:33 PM


All times are GMT -4. The time now is 02:00 AM.



Search Engine Optimization by vBSEO 3.3.0