回调函数高级
源码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script type="text/javascript">
function f(num,callback){
return(callback(1));
}
function test(){
num = 10000;
var that = this;
this.me = 111;
alert(f(num,function(back){ //匿名高层处理函数
return that.me + back ;
}) + 10); //122
}
test();
</script>
</head>
<body>
</body>
</html>
完