Dynadot โ€” .com Transfer

JavaScript Tell A Friend

SpaceshipSpaceship
Watch
A JavaScript Tell-A-Friend

Enter this between the <head> and </head> tags.
Code:
DO NOT EDIT ANYTHING OTHER THAN THE initialsubj AND initialmsg.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin 

var initialsubj="Hey buddy, take a look at this"
var initialmsg="Hi:\n You may want to check out this site: "+window.location
var good;
function checkEmailAddress(field) {

var goodEmail = 
field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.biz)|(\.name)|(\..{2,2}))$)\b/gi);
if (goodEmail) {
good = true;
}
else {
alert('Please enter a valid address.');
field.focus();
field.select();
good = false;
}
}
u = window.location;
function mailThisUrl() {
good = false
checkEmailAddress(document.tella.email);
if (good) {

//window.location = 
"mailto:"+document.tella.email.value+"?subject="+initialsubj+"&body="+document.title+" 
"+u;
window.location = 
"mailto:"+document.tella.email.value+"?subject="+initialsubj+"&body="+initialmsg
}
}
// End -->
</script>

Enter the following code in between your <body> and </body> tags. Where you want the form to appear.

Code:
<form name="tella">
Tell a friend:
<input type="text" name="email" size="26" value=" Enter Address 
Here" onFocus="this.value=''" onMouseOver="window.status='Enter email 
address here and tell a friend about this site...'; return true" 
onMouseOut="window.status='';return true">
<br>
<input name="button" type="button" onClick="mailThisUrl();" 
onMouseOver="window.status='Click to send an email (with this page 
address) to a friend! Enter email address above...'; return true" 
onMouseOut="window.status='';return true" value="Send!">
</form>

Then just upload your page and voila! :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Hey thanks! I will probably use that on one of my sites... much appreciated for sharing that! ^_^
 
0
•••
hey this is not working for me

okay here is what i did

i created a file called sendhead.txt
and added the content of the head tag in there...and then i used the php include tag to include this file between <head> tags

then i added the body content to a file sendbody.txt and did the same thing and included this in the <body> tags

the email FORM shows but nothing happens when i click send :-s

http://www.funnymedia.net/mpages/folding_shirt.php the URL
 
0
•••
Spaceship
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back