ben3001 Posted November 23, 2006 Share Posted November 23, 2006 Hi, i have a basic 404 page, <div id="content"> <p class="style5">Error #404 </p> <p><img src="image/error.png" alt="error" width="50" height="55" />The requested URL: <stong> <script LANGUAGE="JavaScript"> <!-- document.write('<A HREF="' + location.href +'">'); document.write(location.href); document.write('</A>'); // --></SCRIPT></strong> was not found on this server </p> <p>This page may have moved or is no longer available<br /> Please try one of the following options: </p> <ul> <li>Check the Web address you entered to make sure if it's correct. </li> <li>Try to access the page directly from the <a href="index.html">Home page</a> or <a href="sitemap.html">site map</a>, instead of using a bookmark. If the page has moved, reset your bookmark</li> <li>Alternatively email <a href="mailto:error@aquatic-management.org?subject=Error Report:">error@aquatic-management.org</a> with the broken url as the subject, and the problem will be sorted. </li> </ul> <p><br /> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> i have JS capturing the current url <script LANGUAGE="JavaScript"> <!-- document.write('<A HREF="' + location.href +'">'); document.write(location.href); document.write('</A>'); // --></SCRIPT> i also have a mailto link <a href="mailto:error@aquatic-management.org?subject=Error Report:"> is it possible for me to put the javascript into the mailto link, so that the subject reads, Error Report: http://site.com/dfdfd (what ever the broken url was)cheersB Link to comment Share on other sites More sharing options...
jesh Posted November 27, 2006 Share Posted November 27, 2006 You could do something like this: <a href="mailto:error@aquatic-management.org?subject=Error Report: " id="mailto">Email Us</a><script type="text/javascript">var mailto = document.getElementById("mailto");mailto.href += "http://thebrokenlink.com/";</script> Then, instead of appending "http://thebrokenlink.com" to the end of the href, you could append the URL of your page. Link to comment Share on other sites More sharing options...
ben3001 Posted November 27, 2006 Author Share Posted November 27, 2006 cheers for that i kinda changed it just added location.href instead of the url: <a href="mailto:error@aquatic-management.org?subject= Broken URL: " id="mailto">Email Us</a><script type="text/javascript">var mailto = document.getElementById("mailto");mailto.href += (location.href);</script>the only problem is that i.e and firefox render the links differently, any way to change this?see for your selfhttp://aquatic-management.org/hjhhjh Link to comment Share on other sites More sharing options...
jesh Posted November 27, 2006 Share Posted November 27, 2006 You gotta love IE!I don't have any idea why IE decides to change the innerHTML of the link when you change the href, but, you can add some redundant code so that IE renders it correctly: <script type="text/javascript">var mailto = document.getElementById("mailto");mailto.href += (location.href);mailto.innerHTML = "error@aquatic-management.org";</script> If someone else could explain why IE changes the innerHTML when you specify a new href using the HTML DOM, I'd be interested in hearing that explanation. Link to comment Share on other sites More sharing options...
Beta Posted November 27, 2006 Share Posted November 27, 2006 IE6 Renders that perfectly fine when i do it=Pbut if you have problems then just create the link=/ <span id="mailto"></span><script type="text/javascript"><!--var mailto = document.createElement("A");mailto.href = "mailto:error@aquatic-management.org?subject=Broken URL: " + location.href;mailto.innerHTML = "Email Us";document.getElementById("mailto").appendChild(mailto);// --></script> and append it=P Link to comment Share on other sites More sharing options...
ben3001 Posted November 28, 2006 Author Share Posted November 28, 2006 cheers for that its working nowhttp://aquatic-management.org/hjhhjhfdfgdgfdgffdgdf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now