Javascript 中定义函数回调
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
<html>
<head>
<title>
jsp3
</title>
</head>
<body bgcolor="#ffffff">
<script language="javascript" type="text/javascript">
function A(a,callback){
var b=callback;
/*
var msg='';
for(key in b){
msg+=key;
msg+=' => ';
msg+=b[key];
msg+='
';
}
document.getElementById('msg').innerHTML='';
document.getElementById('msg').innerHTML=msg;
*/
alert(b.value);
}
function B(c){
return (c);
}
</script> <input type="button" name="Submit" value="Submit" onclick="A(4,B(this));">
<div id='msg'></div>
</body>
</html>