Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

getData(x, y, callback) and showData() callback function

<html>
<head>
<style>
</style>
</head>
<body>
<h1>Softhunt.net</h1>
<h3> The getData() function is called its arguments and the callback is executed after the completion of getData() function. </h3>
<script>
function getData(x, y, callback){
document.write(" The multiplication of the numbers " + x + " and " + y + " is: " + (x*y) + "<br><br>" );
callback();
}
function showData(){
document.write(' This is the showData() method execute after the completion of getData() method.');
}
getData(15, 60, showData);

</script>
</body>

</html>
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #callback #function
ADD COMMENT
Topic
Name
7+2 =