错误代码:
with(obj)
{
onchange = function (){calendar.update(calendar);}
onblur = function (){calendar.onblur();}
}
报错“with’ is not allowed in strict mode”
分析问题:由于js在严格模式下不允许使用with关键字!
修改后代码:
obj.onchange = function (){calendar.update(calendar);}
obj.onblur = function (){calendar.onblur();}
参考链接