Here are my functions:
<a onClick="check_claims(this)" type="button" href="javascript:void(0)" redirurl="www.facebook.com" >Invite</a>
function check_claims(ele){
var select_claims = document.getElementById('select_claims').value;
if (select_claims == '1') {
var result = confirm("do you wish to continue?");
if (!result) {
check_email_address();
return;
}
}
check_email_address();
window.location.href = ele.getAttribute('redirurl');
}
function check_email_address(){
if ('{{broker.email_address}}' == 'None') {
console.log('this worked till here');
window.location.href = 'www.google.com';
}
}
I have recently added the check_email_address
function. It is being called and the log message is printed, but the window.location.href
in this function is not recognized, and the page continues to redirect to the URL specified in the first function's window.location.href
.