2012-04-13 71 views
0

我不得不做出一个功能上传图像,但是当我在那个时候重置IE9布劳尔我的功能不能正常工作重置Internet Explorer 9中后不能得到正确的结果

//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中上传的文件详细信息?

回答

0

的一个问题是,你有拼写错误behaviorUrns

为您的代码的一些建议:

//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; 
    } 
    } 
} 
+0

这个函数的我ProblemL目的是,如果用户已经上传了照片返回true。我找不到任何方法来知道用户是否已经上传图片。我发现上传图片时node.behaviorUrns.length发生了变化。但是,在用户重置IE9设置后,这不起作用。如果有另一种更好的方式来查找用户是否上传了图片(照片),我需要帮助。 – 2012-04-13 12:42:42