関数(それ自体にパラメーターがあるとしましょうpara)をパラメーターとして別の関数関数b()に渡し、パラメーターparaを取得する方法。
ここに簡単な例があります
<input type="button" onclick="sometest3()" value="Run test">
<script>
function sometest3() {
// pass an anonymous function as a parameter which has
// its own parameter "client"
sometest('connection',function(client){client.getInfo();})
}
function sometest(eve,func) {
// get this function's parameter which is "client" and pass
// a reference of sometest2 to it. so in the callback I can use
client.getInfo();
}
function sometest2() {
this.getInfo=function (){alert("get it");};
}
</script>