function RegisterEvent(target, eventTarget)
{
if (target != null)
{
target.onchange = (function(old, tg)
{
return function()
{
if (old != null) old.call(this, arguments); // Note that the following element names are negotiable - you can use your own...
document.forms[0].elements["__EVENTTARGET"].value = tg;
document.forms[0].submit();
};
})(target.onchange, eventTarget);
}
}

解决方案 »

  1.   

    function RegisterEvent(target, eventTarget)
    {
    if (target != null)
    {
    target.onchange = (function(old, tg)
    {
    return function()
    {
    if (old != null) old.call(this, arguments); // Note that the following element names are negotiable - you can use your own...
    document.forms[0].elements["__EVENTTARGET"].value = tg;
    document.forms[0].submit();
    };
    })(target.onchange, eventTarget);
    }
    }
      

  2.   

    能具体解释解释么?或者写成好几个function的形式?看不太懂这种写法。