In this article of Jquery we will learn about CallBack so Let's start.
@{
ViewBag.Title = "Call Back";
}
<h2>Call Back</h2>
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="~/js/CallBack.js" type="text/javascript"></script>
</head>
<body>
<!--The example below has a callback parameter that is a function that will be executed after the hide effect is completed:-->
<h3>The example below has a callback parameter that is a function that will be executed after the hide effect is completed:</h3>
<p id="firstpara">This is para</p>
<button id="firstbtn">Enter</button>
<!--End-->
<br /><br /><br /><br /><br /><br />
<!--The example below has no callback parameter, and the alert box will be displayed before the hide effect is completed:-->
<h3>The example below has no callback parameter, and the alert box will be displayed before the hide effect is completed:</h3>
<p id="secondpara">This is para</p>
<button id="secondbtn">Enter</button>
<script>
$(document).ready(function () {
$("#firstbtn").click(function () {
$("#firstpara").hide("slow",function () {
alert("Para has been removed")
})
});
$("#secondbtn").click(function () {
$("#secondpara").hide(1000);
alert("You hide the para")
});
});
</script>
</body>
</html>
Comments
Post a Comment