When the user clicks on an internal link, I want to call a JavaScript function that will display a confirmation message. I tried using the code below, but it didn’t work. Any ideas? Thanks.
[code]<a href=”javaxcript:void(0);” onclick=”javascript:return confirmExit(‘html_tables.html’)”>Tables</a>
I’m not sure that this code will work either. My JavaScript is pretty rusty.
[code]<script type=”text/javascript”>
function confirmExit(var link)
{
var reply = confirm(“Are you sure you want to quit this exam?nYour exam score will not be saved.”);
if (reply == true) {
window.location.href=”‘” + link + “‘”
}
return false
}
</script>