2013-07-10 55 views
0

我看了又看,但无法找到解决这个问题的准确。我有一个返回一对夫妇值成变量形式_和_。我正在使用这些值通过'setfilenameinbox'函数更新其他表单值。这部作品在Chrome和Firefox的罚款,但价值不,我已经与(包括7 & 8)测试的IE浏览器的所有版本进行更新。的getElementById在IE中失败,工作在Chrome和FF

非常感谢知道为什么代码不能在IE浏览器。

<script type="text/javascript"> 

    function setfilenameinbox(uploadname, url){ 
     document.getElementById("textboxFileName").value = uploadname; 
     document.getElementById("FPFileURL").value = url; 
    } 

    function openFilePicker(){ 

     filepicker.setKey('***edited out for help***'); 

     filepicker.pick({ 
      extensions: ['.pdf', '.jpg'], 
      container: 'window', 
      services:['COMPUTER', 'DROPBOX', 'GOOGLE_DRIVE'], 
      }, 
      function(FPFile){ 
       console.log(JSON.stringify(FPFile)); 

       //upload complete 
       setfilenameinbox(FPFile.filename, FPFile.url); 
       }, 
      function(FPError){ 
       console.log(FPError.toString()); 
       } 
     ); 
    } 
</script> 

回答

3

我认为IE7和8具有没有console对象(除非一些库或插件具有一个供给它)。 console.log应该在< IE8中破坏你的代码。我建议你删除生产中的console命令。

+0

谢谢。我会看看我是否可以在不使用'console.log'的情况下重新编写函数,看看会发生什么。 – Mark

相关问题