I want go to 'cart.aspx' page from 'country.apsx' byHide Copy Code
<a id="linkCart" href="cart.aspx">cart</a>
but in 'cart.aspx' i am checking cookie value byHide Copy Code
var userCookie = getCookie('loggedInUser');
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length, c.length);
}
return null;
}
if (userCookie == null)
{
window.location.href = "loginpage.aspx";
}
then if cookie value null then have to go 'login.aspx' page otherwise load this 'cart.aspx' page onlybut when I click on 'cart' (anchor tag) then first displaying cart page then displaying loading.aspx page after condition is get true..where as have to display directly 'login.aspx' page without display 'cart.aspx' page. so what to do?