Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Javascript call
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rkroone
Novice

Netherlands
3 Posts

Posted - 07 Apr 2006 :  21:56:31  Show Profile  Visit rkroone's Homepage  Reply with Quote
I have an e-mail riddler (for encrypted e-mail address) script from dynamicdrive. This is added to the head of a page or added as a external script link. This is the exact script:
<SCRIPT type=text/javascript>

/***********************************************
* Encrypt Email script- Please keep notice intact.
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/

var emailarray1144= new Array(105,110,102,111,64,119,101,108,108,102,105,101,108,100,46,110,108)
var postemail1144=''
for (i=0;i<emailarray1144.length;i++)
postemail1144+=String.fromCharCode(emailarray1144[i])

document.write('<a href="mailto:'+postemail1144+'">send mail</a>')

</SCRIPT>

All I want is to assign the script to a label (called send mail), so the label can be used as a link to send mail. How can this be done?
I tried several thing with events, but nothing works.
I am not a good java scripter, I prefer to borrow them :-)

s.dav
Site Admin

Italy
3364 Posts

Posted - 08 Apr 2006 :  10:59:52  Show Profile  Visit s.dav's Homepage  Reply with Quote
Very simple ;-)

1- create your label or your graphical object
2- edit the events for this object (for the standard label you have to select a part of text in the label editor and press the link menu item)
3- in the event window choose onClick and JavaCall
4- in the javacall text field write 'sendMail();' without the ' char
5- create the sendMail() function basing on your code:

<script language="javascript" type="text/javascript">
<!--
function sendMail()
{
var emailarray1144= new Array(105,110,102,111,64,119,101,108,108,102,105,101,108,100,46,110,108)
var postemail1144=''
for (i=0;i<emailarray1144.length;i++)
postemail1144+=String.fromCharCode(emailarray1144[i])

document.location="mailto:"+postemail1144;
}
//-->
</script>

6- Paste this script section in the head section of your page by double-clicking over a blank part of your page; in the page properties window press Scripts/event and Header code.

Regards, Davide
Go to Top of Page

rkroone
Novice

Netherlands
3 Posts

Posted - 08 Apr 2006 :  21:53:49  Show Profile  Visit rkroone's Homepage  Reply with Quote
This works great. Thanks a lot!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000