87,984
社区成员
发帖
与我相关
我的任务
分享<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>脚本测试</title>
<script type="text/javascript">
function CD(str) {
alert(str);
document.getElementById("box").innerHTML = str;
}
function AB() {
alert('12');
}
Function.prototype.hookend = function (hook) {
var fn = this;
return function () {
ret = fn.apply(this, arguments);
hook.apply(this, arguments);
}
}
AB = AB.hookend(function () { alert('32') });
//此处己实现AB的重载,请问如何实现方法CD(str)的重载呢
// AB();
</script>
</head>
<body>
<div id="box" style="color:Red;font-size:16px;">原先的内容</div>
<script type="text/javascript">
</script>
</body>
</html>