I know this is a question much discussed but I can\'t figure out why it does not work for me.
This is my function:
function ShowComments(){ alert(\
Though it is very old question, i would like to answer as i faced same issue recently and got solution from here -
http://www.codeproject.com/Questions/727493/JavaScript-document-location-href-not-working Solution:
document.location.href = 'Your url',true;
This worked for me.