IE8 Javascript错误

时间:2011-06-20 05:36:01

标签: javascript internet-explorer jsp

网页在Mozilla Firefox中运行良好,但尝试通过IE8访问时,同一页面会抛出以下错误:

  

网页错误详情

     

用户代理:Mozilla / 4.0(兼容;   MSIE 8.0; Windows NT 5.1;三叉戟/ 4.0;   msn OptimizedIE8; ENIN)时间戳:周一,   2011年6月20日05:20:13 UTC

     

消息:参数无效。行:122   字符:3代码:0

如何解决这个问题?

function doBatchPrintPaySlipPentaho(form)
{

    var list = '';
    if(form.employeeIdList == null)
    {
        alert("No record for Batch Printing");
        return false;
    }
    if(form.employeeIdList.checked==false)
    {
        alert("Select one Employee");
        return false;
    }
    if(form.employeeIdList.checked == true)
    {
        list = "|" + form.employeeIdList.value;

    }
    else
    {
        var count=0;
        for(var i=0;i<form.employeeIdList.length;i++)
        {
            if(form.employeeIdList[i].checked == true)
            {
                count++;
                list += "|"+form.employeeIdList[i].value;
            }

        }
        if(count == 0)
        {
            alert("Select atleast one record");
            return false;
        }
    }


    ////////////////////////////////////////
    var branchIdsTemp="";
    var employeeIdsTemp="";



    if(form.employeeIdList == null)
    {
        alert("No record for Batch Printing");
        return false;
    }
    if(form.employeeIdList.checked==false)
    {
        alert("Select one Employee");
        return false;
    }
    if(form.employeeIdList.checked == true)
    {
        list = "|" + form.employeeIdList.value;

    }
    else
    {
        var count=0;
        for(var i=0;i<form.employeeIdList.length;i++)
        {
            var xyz="";
            if(form.employeeIdList[i].checked == true)
            {
                count++;
                list += "|"+form.employeeIdList[i].value;
                xyz=form.employeeIdList[i].value.split("*");
                employeeIdsTemp=employeeIdsTemp+"&employee="+xyz[0];

            }

        }

        if(count == 0)
        {
            alert("Select atleast one record");
            return false;
        }
    }

    if(document.PaySlipGeneration.branch.value!='x')
    {
        branchIdsTemp="&branchId="+document.PaySlipGeneration.branch.value;
    }
    else
    {
        var allIds=document.PaySlipGeneration.allBranchIds.value.split("*");
        for(var z=0;z<allIds.length-1;z++)
        {
            branchIdsTemp=branchIdsTemp+"&branchId="+allIds[z];
        }
        //alert("branchIdsTemp : "+branchIdsTemp);
    }
    //return false;
    var tempFromDate="";
    var tempToDate="";
    var temp4=document.PaySlipGeneration.fromDate.value.split(".");
        tempFromDate=temp4[2].whiteSpaceTrimmer()+"-"+temp4[1].whiteSpaceTrimmer()+"-"+temp4[0].whiteSpaceTrimmer();
    var temp5=document.PaySlipGeneration.toDate.value.split(".");
        tempToDate=temp5[2].whiteSpaceTrimmer()+"-"+temp5[1].whiteSpaceTrimmer()+"-"+temp5[0].whiteSpaceTrimmer();

//window.open('batchSalarySlip?list='+list+'&from='+PaySlipGeneration.fromDate.value+'&to='+PaySlipGeneration.toDate.value+'&isFirstTime=true','','width=760,height=600,menubar=yes,scrollbars=yes');

    MM_openBrWindow('http://reports.ofsy.net/pentaho/content/reporting/reportviewer/report.html?showParameters=false&output-target=pageable/pdf&solution=ofsyReports/bauto/payroll&path=&name=paySlipReport_bauto.prpt&locale=en_US#from='+tempFromDate.whiteSpaceTrimmer()+'&to='+tempToDate.whiteSpaceTrimmer()+branchIdsTemp+employeeIdsTemp+'&showParameters=false','&output-target=pageable/pdf','','width=1000,height=700,top=70,left=10');


//MM_openBrWindow('http://reports.ofsy.net/pentaho/content/reporting/reportviewer/report.html?showParameters=false&output-target=pageable/pdf&solution=ofsyReports/sta/payroll&path=&name=BankStatementReport_sta.prpt&locale=en_US#accNo='+accNo.whiteSpaceTrimmer()+'&from='+tempFromDate.whiteSpaceTrimmer()+'&to='+tempToDate.whiteSpaceTrimmer()+"&for_month="+for_month.whiteSpaceTrimmer()+branchIdsTemp+departmentIdsTemp+employeeIdsTemp+'&showParameters=false','&output-target=pageable/pdf','','width=1000,height=700,top=70,left=10');

}

1 个答案:

答案 0 :(得分:0)

您的窗口打开肯定是非法的

MM_openBrWindow('some long url',
'&output-target=pageable/pdf','','width=1000,height=700,top=70,left=10');

您需要找到一种方法来删除'&amp; output-target = pageable / pdf'或之前的逗号。

同时给窗口命名,例如

MM_openBrWindow('some long url....&output-target=pageable/pdf',
'newWindow','width=1000,height=700,top=70,left=10');