Get best price on Unlocked Moto G Stylus | ||||||||||||
|
||||||||||||
|
JavaScript: Emailing 404 Error InformationUse JavaScript to create helpful, dynamic 404 error pages.
A helpful 404 page displays the link that is broken and the referring document (the page the visitor came from). It could also provide a link to an email address where this info was the subject line of an email to myself. Gathering the Location and Referrer Info The JavaScript for location and referrer:
<script language="JavaScript">
loc = document.location.href; ref = document.referrer; document.write("<p><b>Broken Link:</b> "+loc+"</p>"); document.write("<p><b>Referring Document:</b> "+ref+"</p>"); </script> Using this page as an example (as though this were the broken link), we would display the following on the error page: Emailing the 404 Page Information Use a simple Write out the above document information to the mailto statement using
JavaScript The JavaScript for emailing the details:
<script language="JavaScript">
document.write("You can email the details to <a href='mailto:webmaster@yoursite.com?subject=404 URL: "+loc+" REFERRER: "+ref+"'>webmaster@yoursite.com</a>"); </script> This displays: Mouse over the link to see the info built into the link that is the subject line of the email.
|
privacy policy || © 1997-2016. astonishinc.com All Rights Reserved. |