<script language="javascript">
function MyFunctions()
{}MyFunctions.prototype.executeFunc=function(Func)
{
Func.exec();
}
</script><script language="javascript">
function test()
{}
test.prototype.exec=function()
{
alert("test succeeds!");
}
</script><script language="javascript">
var MF=new MyFunctions();
var test=new test();
MF.executeFunc(test); //这里把test作为对象传入对象MF中,并在MF的exeFunc()方法中调用test对象的exec()方法,但失败了,请问应该怎样写?
</script>
function MyFunctions()
{}MyFunctions.prototype.executeFunc=function(Func)
{
Func.exec();
}
</script><script language="javascript">
function test()
{}
test.prototype.exec=function()
{
alert("test succeeds!");
}
</script><script language="javascript">
var MF=new MyFunctions();
var test=new test();
MF.executeFunc(test); //这里把test作为对象传入对象MF中,并在MF的exeFunc()方法中调用test对象的exec()方法,但失败了,请问应该怎样写?
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货