在IE7中,两个函数在window.onload中不起作用

时间:2012-06-19 10:44:13

标签: javascript internet-explorer

window.onload = function () {
  new JsDatePick({
    useMode: 2,
    target: "prod_war",
    dateFormat: "%Y-%m-%d",
  });
  showResult('SHOW', '', '');
};

上述功能无法在Internet Explorer中执行onload

1 个答案:

答案 0 :(得分:6)

删除"额外"逗号:

window.onload = function () {
  new JsDatePick({
    useMode: 2,
    target: "prod_war",
    dateFormat: "%Y-%m-%d" // comma removed from here
  });
  showResult('SHOW', '', '');
};

IE抱怨这个 - 其他浏览器倾向于忽略它