0

画像をアップロードするための関数を1つ作成しましたが、そのときに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

1つの問題は、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;
    }
  }
} 
于 2012-04-13T02:58:24.473 に答える