callback not working
callback not working
Hi,
I'm new to jquery and i'm trying to call a method on load and which will perform some task and once task is done i need to display the info.
Everything is working fine but callback is not working.
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
getall(function(){
$("P").append("<br/>call back done");
});
});
function getall()
{
$("P").append("<br/>page loaded");
}
</script>
</head>
<body>
<p>This is a paragraph with little content.</p>
</body>
</html>
Even i tried...
<script>
$(document).ready(function(){
getall(function(){
$("P").append("<br/>call back done");
});
});
function getall(callback)
{
$("P").append("<br/>page loaded.<br/>" +callback);
}
</script>