enter image description hereI'm using javascript that when the clicks the log off button and clicks it redirects them to another page and additional if the user clicks cancel it remains on the page the user was on. My issue is that it is not redirecting but if I put a alert I can get the alert message
.
Javascript:
function Exit() {
var bResponse = confirm('Are you sure you want to exit?');
if (bResponse) {
alert("You are being logged out ");
window.location.href = '@Url.Action("Index", "Home")';
}
else
alert ("You may have other options.") //trying the alert
}
HTML Link
<li><a href=""onclick="return Exit()">Log Off </a></li>
function Exit() {
var bResponse = confirm('Are you sure you want to exit?');
if (bResponse) {
alert("You are being logged out ");
window.location.href = '@Url.Action("Index", "Home")';
}
else
alert ("You may have other options.") //trying the alert
}
#spanId
{
cursor:pointer;
}
<li><span id="spanId" onclick = "Exit();">Log out</span></li>
Should be:
<li><span onclick="Exit()">Log Off </span></li>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments