joecool2005 Posted April 10, 2006 Share Posted April 10, 2006 Hi,I want to use history.back inside a link like this<script type="text/javascript">document.write("<a href=\"java script:void(0);\" onclick='history.back();'>Please try again.</a>")</script>But it does not work.How can I fix it?Thxjoe Link to comment Share on other sites More sharing options...
Little Goat Posted April 10, 2006 Share Posted April 10, 2006 I think you need to put a 1 inside the perentheses, and you can put the javascript in the hrefinstead of the onclick: <a href="javascript:history.back(1)">Please try again</a> or if you have to use document.write: document.write("<a href=\"javascript:history.back(1)\">please try again</a>") There ya go :)LG Link to comment Share on other sites More sharing options...
aspnetguy Posted April 10, 2006 Share Posted April 10, 2006 this should work<a href="java script:history.back()">Please try again</a>or document.write('<a href="java script:history.back()">Please try again</a>'); Link to comment Share on other sites More sharing options...
pulpfiction Posted April 10, 2006 Share Posted April 10, 2006 Or this ,<script type="text/javascript">document.write("<a href=\"#\" onclick='history.back();'>Please try again.</a>")</script> Link to comment Share on other sites More sharing options...
joecool2005 Posted April 10, 2006 Author Share Posted April 10, 2006 Thank you guys!Both of them work very well!Joe 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