Working on some dynamic pages and specifically we have profile pages for users. However there are several routs for them to get to these pages so its not practical to set up a specific rout for the back button.
here is my code:
<%= link_to_function "Back", 'javascript:history.back()', { :class => "button-back" } %>
and it generates this html:
<a href="#" class="button-back" onclick="javascript:history.back(); return false;">Back</a>
this is working in IE and Firefox but not Chrome….What gives? I have looked at the other stack questions that are similar but none of them are browser specific and according to them this should work. Any help would be appreciated.
Edit:
After further testing it turns out the real problem is that this is working in chrome but is not working when I drop the pages into an Iframe and try and use the button to navigate inside of a chrome extension. The reason I am doing this is because we are using these pages cross browser in different apps/extensions/toolbars depending on the browser. Its working in all of them except our chrome extension.
The
javascript:protocol it for hrefs, not for onclicks. If you take out thejavascript:it might work:It’s strange to me that IE and Firefox accept that though..