make Callback function and check if it is undefine in javascript

<!DOCTYPE html>

<html>
<script>
window.onload = hello;

function hello(){
test(function aaa(){
alert('callback success');
});

test();
}

function test(callback){
if(typeof callback  != 'undefined'){

callback();
}
}
</script>

</html>

Comments

Popular posts from this blog

codefights smooth sailing ( CommonCharacterCount)

How to remove 8443 port in URL in tomcat