Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Encode email address, but don’t open email client when clicked on?
Old 03-13-2009, 08:52 AM Encode email address, but don’t open email client when clicked on?
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
There are quite a few sites that will let you encode your email address via JavaScript to show it on a web site without bots being able to find it, & therefore spam it (or at least it stems the tide).

When you click on them it opens a new email message in the user’s email client with the email address in the ‘to’ field.

What I want to do is display an email address on a web site & encode it in JavaScript (to help prevent spam), but I don’t want it to open a new email when clicked on (I want to activate some different JavaScript instead).

Does anyone know if this would be possible?
FOOOD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-13-2009, 09:12 AM Re: Encode email address, but don’t open email client when clicked on?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Don't set it as a mailto: link and use an onclick event on the container
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-13-2009, 09:22 AM Re: Encode email address, but don’t open email client when clicked on?
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
Thanks for replying.
I don't have anything set as mailto: it just looks like gobbledy gook

Anyway, never-mind. I found the solution on the site where I encoded the original email address

Last edited by FOOOD; 03-13-2009 at 09:31 AM..
FOOOD is offline
Reply With Quote
View Public Profile
 
Old 03-13-2009, 09:58 AM Re: Encode email address, but don’t open email client when clicked on?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Okaaay, that might take a bit of decoding

Why do you need to encode it if you are calling a function rather than displaying an email address?
Just use document.write()
Here is what I do http://www.candsdesign.co.uk/article...il/javascript/

But if you want to encode the HTML - http://hivelogic.com/enkoder/form
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-13-2009, 10:21 AM Re: Encode email address, but don’t open email client when clicked on?
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
It's to initiate an animation that makes an ajax contact form appear.

Enkoder is what I was using, & able to use to make the new code.
Thanks for the other link
FOOOD is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Encode email address, but don’t open email client when clicked on?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30948 seconds with 12 queries