首页 > 解决方案 > IE SCRIPT1002 匹配函数返回错误

问题描述

我有一个问题,我的代码在除 IE 之外的所有浏览器中都能正常工作。IE 返回 SCRIPT1002 语法错误。这一行: if(data.responseText.match(/Произошла.*/)) { 下一个代码:

  localRequest: function(period, adapter, adapterType, errText){
            let _this = this;
            let iRow = rowInfo.iRow;
            let aboutRow = rowInfo.aboutRow;
            queryState = $.ajax({
                type: 'get',
                url: 'api/ds/cs',
                dataType: 'json',
                data: {
                    period: period,
                    adapter: adapter,
                    adapterType: adapterType,
                    errText: errText,
                    subject: iRow.value,
                    body: aboutRow.value
                },
            }).done(function (data) {
 
            }).fail(function(data){
               **if(data.responseText.match(/Произошла.*/)) {**
                        let errText = data.responseText.split(')',)
                        let errNumb = errText[0].split('(',)
                   
                        alert('Не удалось сформировать проишествие: ' + errText[1] + ' №' + errNumb[1])
 
                    } else {
                        alert(data.responseText);
                    }
            })
        },

标签: javascriptinternet-explorersyntaxsyntax-error

解决方案


推荐阅读