TCH-Thomas Posted September 21, 2003 Posted September 21, 2003 Hi all, Thought it was time to peek in to this part of the TCH forum too. Most of you know me as Tonsa at the official CSB-forum. I know the following problem should have gone to scripting part of this forum, but since i use CSB´s insert... Im not sure if this is done different. I found a script for a recommend to a friend link. The script makes a line saying "Send this page to a friend" but only the part "this page" is a link. I want the whole line to be clickable. How do i do that? Here´s the script: <!-- ONE STEP TO INSTALL SEND THIS PAGE: 1. Copy the coding into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the BODY of your HTML document --> <script LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Original: David Henry (davidputhenry@hotmail.com) --> <!-- Web Site: http://www.davidphenry.com/ --> <!-- Begin function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true; else return false; } if(isPPC()) { document.write('Send this page to a friend'); } else { document.write('Send this page to a friend'); } // End --> -Thomas Quote
TCH-Andy Posted September 21, 2003 Posted September 21, 2003 Hi Tonsa, I'm not a CSB guru, but looking at it from a script / HTML viewpoint, if you change the line >document.write('Send <A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend'); to >document.write('<A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">Send this page to a friend<\/A>'); Then I think it should work. Andy PS. you will also need to change the line just below it in the same way. Quote
TCH-Thomas Posted September 21, 2003 Author Posted September 21, 2003 Worked very well. Thanks. -Thomas Quote
TCH-Thomas Posted September 21, 2003 Author Posted September 21, 2003 (edited) Just one little problem with it... Since I use frames on the page its used on, it send the url ...start_l.htm and not the whole viewable url. So i was thinking if i could put the correct url there instead of ' + window.location + ' then it would lead to start.htm instead and not just a frame. Is that possible and if so, how? I know...Im no good at scripts. -Thomas Edited September 21, 2003 by Tonsa Quote
TCH-Andy Posted September 21, 2003 Posted September 21, 2003 Hi, Yes, that should be fine. The only reason it is in the script that way is so that you don't have to type it in every time. If you type in the address as you suggest though it should work perfectly. Andy Quote
TCH-Thomas Posted September 22, 2003 Author Posted September 22, 2003 Now Im getting a error message on line 230 it says a ) is expected. Lets assume this url I wanna add is my own (www.jikrantz.com), is the following lines correct then? document.write('http://www.jikrantz.com + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">Send this page to a friend'); } else { document.write('http://www.jikrantz.com + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">Send this page to a friend'); } -Thomas (confused about scripting) Quote
TCH-Don Posted September 22, 2003 Posted September 22, 2003 document.write('<A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + http://www.jikrantz.com + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">Send this page to a friend<\/A>');} else { document.write('<A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + http://www.jikrantz.com + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">Send this page to a friend<\/A>'); } Thomas try adding the single quotes around the url ' + 'http://www.jikrantz.com' + '\" Quote
TCH-Thomas Posted September 22, 2003 Author Posted September 22, 2003 Ok guys, who volunteers to become my teacher in scripts, pay is low (if existing and it will problably take a hundred years). What turtle told me to do worked well except for this: Subject: Take a look at this page I found, ?body=You can see this page at: http://www.jikrantz.com How do I get rid of the ?body= ? -Thomas (who feels a little embarrassed now ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.