佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1229|回复: 1

在IE行得通,在mozilla firefox却不能。HTML coding求救!!

[复制链接]
发表于 19-11-2007 05:51 PM | 显示全部楼层 |阅读模式
各位大大,帮帮忙,我想把网上的资料save下来,在自己的电脑存档。这coding在IE是行得通的,能顺利的储存。但在 mozilla firefox时,就丢给我酱的error..有那位大大面临过酱的难题?可否帮帮小弟啊?


        var bV=parseInt(navigator.appVersion);
         //Broserver Detect");
        var agt=navigator.userAgent.toLowerCase();
        var isGecko     = (agt.indexOf('gecko') != -1);
        var isMozilla   = (isGecko && agt.indexOf(\"gecko/\") + 14 == agt.length);
        var isNS        = ( (isGecko) ? (agt.indexOf('netscape') != -1) : ( (agt.indexOf('mozilla') != -1) && (agt.indexOf('spoofer') == -1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera') == -1) && (agt.indexOf('webtv') == -1) && (agt.indexOf('hotjava') == -1) ) );
        var isIE        = ( (agt.indexOf(\"msie\") != -1) && (agt.indexOf(\"opera\") == -1) && (agt.indexOf(\"webtv\") == -1) );
        // browser version
        var versionMinor = parseFloat(navigator.appVersion);
        // correct version number
        if (isNS )
        {
          versionMinor = parseFloat( agt.substring( agt.lastIndexOf('/') + 1 ) );
        }
        else if (isIE && this.versionMinor >= 4)");
        {
          versionMinor = parseFloat( agt.substring( agt.indexOf('msie ') + 5 ) );
         }
        else if (isMozilla)
        {
         versionMinor = parseFloat( agt.substring( agt.indexOf('rv:') + 3 ) );
        }
         var isIE55down = (isIE && versionMinor < 5.5);
         var ie = (agt.indexOf(\"msie\") != -1);
         var ie4  = (ie && (bV == 4) && (agt.indexOf(\"msie 5.0\")==-1) );
         var IE55 = (ie && !(ie4));
        var IE60 = (ie && (agt.indexOf(\"msie 6.0\") != -1));
         NS4=(document.layers) ? true : false;
         ver4 = (NS4 || IE55) ? true : false;
         NS6 = ((document.getElementById) && (bV>=5)) ? true:false;
        function onSaveClick()
        {
          if ( (isIE55down) || (isNS) )
           {
              document.frmParam.savefile.value = 'true';
              document.frmParam.submit();
           }
        else
        {
         if( parent.workspace )
         {
           parent.workspace.document.execCommand('SaveAs',null,' ');");
         } else {
       document.execCommand( 'SaveAs',null,' ');
        }
       }
       }


丢给我酱的error

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: http://localhost/pcm/ft_CorpTxferList_dom_confirm.jsp :: onSaveClick :: line 118"  data: no]
回复

使用道具 举报


ADVERTISEMENT

发表于 20-9-2010 05:56 PM | 显示全部楼层
沒人幫你?問題解決了嗎?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 20-11-2025 03:15 AM , Processed in 0.120449 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表