Using javascript history.back() fails in Safari .. how do I make it cross-browser?
it should be history.go(-1); return false;
or
history.go(-1); event.preventDefault();
You should consider doing it like this instead:
<a href="javascript:history.go(-1)">Back</a>
Try this instead. It should work across IE, FF, Safari and Chrome.
<a href="#" onclick="if(document.referrer) {window.open(document.referrer,'_self');} else {history.go(-1);} return false;">Cancel<a>