|
查看: 1229|回复: 1
|
在IE行得通,在mozilla firefox却不能。HTML coding求救!!
[复制链接]
|
|
|
各位大大,帮帮忙,我想把网上的资料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] |
|
|
|
|
|
|
|
|
|
|
发表于 20-9-2010 05:56 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|