I have a page where user will click on it to send invites to his friend on gmail
here is the button
<button onclick="TwkInvite()" class="btn">
<i class="fa fa-google"></i>Import your Gmail Contacts
</button>
here is the javascript part
function TwkInvite() {
alert('function is called');
window.location.href = "https://accounts.google.com/o/oauth2/auth?client_id=*********-*************.apps.googleusercontent.com&redirect_uri=https://www.example.com/app/invite-send&scope=https://www.google.com/m8/feeds/&response_type=code";
}
I have tried window.location.href, window.location, location.href everything
This function is being executed perfectly as alert is also executed but i don't know why it doesn't redirect to google website, whenever i click on button the page get refreshed
No error is printed, i checked mozilla console also but no error found
