Hi all,
I've a jsp page which saves a request parameter inside a javascript variable. Say a user visits the page through a wish list then the param fromWishList is set to 1, if the user visits this page from other source then there is no param called fromWishList.
//following code is inside a jsp page
<script type="text/javascript">
var isWishList = '<c:out value="${param.fromWishList}" />';
if(isWishList != ''){
//page visited via wishList
} else {
//page visited via other sources
}
</script>
Now my problem is that if a user visits the page via wish list the javascript var isWishList is set permanently set to '1', so that if the same user visits the page again via other sources the isWishList is still set to '1'. In the second case i wanted it to be blank.
I'm struggling with this since long time. I appreciate any help.