<script type='text/javascript'>
$("#cart").click(function() {
var loadUrl = "ajax_redirect.php";
var val = "2";
$.post(loadUrl,
{ page: "cart", data: val },
function(data)
{
alert(data);
alert("Course added to Cart");
}
);
});
</script>
<body>
`<a class="button" id="cart" href="#" title="Apply"><img src="images/button.png" alt="apply" />Apply</a>`
</body>
If i click the <a>
link nothing happens but refreshing. I am not able to get return data value.