Cross Browser Tell a Friend JavaScript
Posted By tomcanji on April 8, 2009
Recently we had a client asking for a “tell a friend” JavaScript that works in all major web browsers.
Why not – how complicate can it be? All I have to do is type something like this in google and I’ll have my “Tell a Friend” working on ie, ie6, firefox, safari in no time… Yeah right.
As you’ve might of guessed that was not the case.
Finally we found something that works so here it is
Copy the js code blelow
var SubjectLine='Take a look at this web page I found, '+top.document.title;
var BodyText='You can see this page at: '+top.location.href;
var Message='Send <A CLASS=contact HREF="mailto:?SUBJECT='+escape(SubjectLine)+'&BODY='+escape(BodyText)+'" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend.';
var MessageIE='Send <A CLASS=contact HREF="mailto:?SUBJECT='+(SubjectLine)+'&BODY='+(BodyText)+'" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend.';
if(document.all) { document.write(MessageIE); }
else { document.write(Message); }
</SCRIPT>
paste this code on the place you want your “Tell a Friend” link to appear
Comments
Dusan Belic says:
tomcanji says:
slim says:
ads says:
dsx says:
Mrs Juliana Dougbo. says:
Steve says:
chard says:
9 Responses to “Cross Browser Tell a Friend JavaScript”
April 9th, 2009 at 12:27 am
Heh. Kad predjes misem preko linka u statusbar-u pise na francuskom, a title (kad malo duze drzis mis na linku) je na engleskom. Ovo je ujedno alatka za ucenje jezika.
April 10th, 2009 at 12:23 pm
Hi Dusan, thanks for noticing
I have fixed this issue. There have also been some bugs concerning the title of “tell a freind” email – this has also been fixed.
June 14th, 2009 at 9:50 pm
bro wat sapp… i want 2 ask u bout disable ctrl + a,c,j,n for ie can work but not realy work in fire fox how.??/ email me.. shahril143@gmail.com
November 14th, 2009 at 9:44 am
asdas
November 14th, 2009 at 9:45 am
dsa
July 23rd, 2010 at 1:20 pm
Dear Friend,
I am Mrs Juliana Dougbo from Kuwait. I am married to late Mr Harris Dougbo, who worked with Kuwait Embassy in Ivory Coast for Twenty-Six years before he died in the year 2002,after a brief illness that lasted for only five days.
We were married for Eighteen years with a daughter (Linda) who later died in a motor accident.
Before the untimely death of my husband,we were both born again Christians. Since after his death I decided not to remarry or get a child outside my matrimonial home which the Bible is against.
When my late husband was alive he deposited the sum of (USD$16.5 Million Dollars ) ( Sixteen Million Five hundred Thousand United States Dollar ) in a bank in Abidjan Cote d’Ivoire. Presently,this money which was originally intended to be invested in the real estate before his untimely death by my husband is still with the bank.
Recently,Following my ill health, my Doctor told me that I may not last for the next eight months due to my cancer problem.The one that disturbs me most is my stroke sickness.Having known my condition I decided to donate this fund to a Christain organization (Church) that will utilize this money the way I am going to instruct herein,according to the desire of my late husband before his death.
I want this fund to be used in Christain Activities like,Orphanages, Christain schools, and Churches for propagating the word of God and to endeavour that the house of God is maintained.
The Bible made us to understand that “Blessed is the hand that giveth”. I took this decision because I don’t have any child that will inherit this money and my husband relatives are not Christians and I don’t want my husband’s efforts to be used by unbelievers. I don’t want a situation where this money will be used in an ungodly way. This is why I am taking this decision.
I am not afraid of death hence I know where I am going. I know that I am going to be in the bosom of the Lord. Exodus 14 VS 14 says that “the lord will fight my case and I shall hold my peace”.
I don’t need any telephone communication in this regard because of my health hence the presence of my husband’s relatives around me always.I don’t want them to know about this development.With God all things are possible.
As soon as I receive your reply I shall give you the contact of the bank in Abidjan. I will also issue you the documents that will prove you the present beneficiary of this fund. I want you and the Church to always pray for me because the lord is my shephard. My happiness is that I lived a life of a worthy Christian. Whoever that Wants to serve the Lord must serve him in spirit and Truth. Please always be prayerful all through your life. Contact me on this e-mail address: any delay in your reply will give me room in sourcing another Church for this same purpose.
Please assure me that you will act accordingly as I Stated herein. Hoping to receive your reply.
Please reply private email:Mrsjulianadougbo@inMail.sk
Remain blessed in the Lord.
Yours in Christ,
Mrs Juliana Dougbo.
August 10th, 2010 at 9:34 pm
Hello,
I saw your blog on disabling Ctrl + keystrokes in IE. I need to do the same thing for my Adobe Captivate modules. Can you advise where I would insert the code for these modules?
Thanks!
February 14th, 2013 at 5:32 pm
do you have a multiple entry to send a email tell a friend like
email text box 1
email text box 2
email text box 3