0

我做了一个上传图片的功能,但是当我当时重置IE9浏览器时,我的功能无法正常工作

//for internet explore browser
function checkLength_forIE(node)
{
    if(node.behaviourUrns.length > 0) //this line give me image is attached or not
  {
      if (document.getElementById) {
        if (!clicked) {
          clicked = true;
          return true;
        } else {
          return false;
        }
      } else {
        return true;
      }
  }
}  

请给我正确的解决方案,当我在如何获取上传文件的数组后重置 IE9 浏览器时?或者任何其他方式在 IE9 中获取上传的文件详细信息?

4

1 回答 1

0

一个问题是你拼错了behaviourUrns

对您的代码的一些建议:

//for internet explore browser 
function checkLength_forIE(node) {

  // To keep safe in other browsers, check for beahviorUrns first
  if (node && node.behaviorUrns && node.behaviorUrns.length) {

    // What is the purpose of this line? I think you need to go back to
    // IE 4 to not have getElementById. In anycase, it is a bad inference,
    // test the property you are actually looking for.
    if (document.getElementById) {

      if (!clicked) {
        clicked = true;
        return true;

      } else {
        return false;
      }

    } else {
       return true;
    }
  }
} 
于 2012-04-13T02:58:24.473 回答