I have an age restricted modal and when the user clicks "no" it goes back a page in their history, but what if a user accessed the webpage on a fresh tab? They don't have a history? Can the button take them to a specific url?The browser's default homepage? Close the tab?
This is what I currently have:
<a onClick="goBack()">Go Back</a>
<script>
function goBack() {
window.history.back();
return false;
}
</script>
In terms of UX, out of the three scenarios I've given, I mean, I'm not sure what's the best, but I'm open to whatever is the most clean to accomplish.