The page URL has to change when the loadTest() function is called on a ahref click. But the page is getting refreshed only when alert is included in the code. If I remove the alert the same page is getting refreshed and not the new URL which I need.
<script type="text/javascript">
function loadText(prod_id)
{
        curUrl = document.location.href.split("?");
        document.location = curUrl[0]+'?prodId='+prod_id;
    alert("Test");
}
</script>
 
     
     
    