Segnala pagina ad un amico JS
Ecco il codice in Javascript che una volta inserito crea un forum che permette di segnalare la pagina ad un amico.
<SCRIPT LANGUAGE=”JavaScript"><br />var initialsubj="Hay buddy, take a look at this"<br />var initialmsg="Hi:n You may want to check out this site: "+window.location<br />var good;<br /><br />function checkEmailAddress(field)<br />{<br /> var goodEmail = field.value.match(/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-]{2,})+.)+([a-zA-Z0-9]{2,})+$/);<br /> if (goodEmail)<br /> {<br /> good = true;<br /> }<br /> else<br /> {<br /> alert(‘Please enter a valid address.’);<br /> field.focus();<br /> field.select();<br /> good = false;<br /> }<br />}<br /><br />u = window.location;<br /><br />function mailThisUrl()<br />{<br /> good = false<br /> checkEmailAddress(document.eMailer.email);<br /> if (good)<br /> {<br /> window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+initialmsg<br /> }<br />}<br /><br /></script><br /><form name="eMailer"><br />Tell a friend:<br /><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 /><br><br /><input type="button” value=”Send this URL” 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” onClick=”mailThisUrl();"><br /></form>”