javascript - 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);
}
})
},
解决方案
推荐阅读
- java - 为什么 BFS 卡在 Graph Node 表示中?
- xamarin - 为什么有权访问源代码并测试我的应用程序的开发人员需要配置文件?
- linux - 如何在自定义的 ubuntu 16.04 中创建 iso
- java - Java:将鼠标光标下当前像素的颜色打印到控制台:鼠标侦听器不起作用
- javascript - 在 React 中更改子状态内的父状态的正确模式是什么?
- azure - Azure 托管应用程序:通过自定义密钥加密磁盘
- web - 如何在 microsoft azure 中自动同步或启动同步调度程序?
- flutter - 我正在从 api 获取数据以获取电晕病毒的统计信息,并想为其绘制饼图,但饼图仅接受双值
- model-view-controller - 403 - 禁止:访问被拒绝。ASP.NET Core MVC IIS 客户端证书 SSL
- python-3.x - Python3.5 openssl 验证证书时出错