JavaScript 回调函数
回调:就是将一个函数作为参数传递给另外一个函数,在另外一个函数里面使用函数
示例如下:
function testParent(str){ str() } ; function testSon(){ console.log("Hello") } ; testParent(testSon);//Hello
- 上一篇 »PHP中删除数组空值的方法
- 下一篇 »PHP中传递回调函数的方法
回调:就是将一个函数作为参数传递给另外一个函数,在另外一个函数里面使用函数
示例如下:
function testParent(str){ str() } ; function testSon(){ console.log("Hello") } ; testParent(testSon);//Hello