以下代码中是否存在导致Chrome出错的内容? IE和Firefox不接受没有附加代码的空格的邮政编码输入,但现在我已添加:
strPostcode = strPostcode.replace(/[^\w\s]/gi, '')
Chrome不会接受输入容器中的邮政编码,并且返回'无法读取属性'toLowerCase'为NULL。任何人都可以对这个错误有所了解,特别是因为只有Chrome才会返回它吗?
// ****************** Event Listners ***************************************************
var myload = map.on("load", loadHandler);
function loadHandler(evt) {
createTOC();
myload.remove();
var strPostcode = GetQueryStringParams('postcode');
if (strPostcode) {
strPostcode = strPostcode.replace(/[^\w\s]/gi, '')
$('#txtsearch').val(strPostcode);
$('.btnSearch').trigger('click');
// PostcodeSearch(strPostcode);
}
}
map.on('update-end', function () {
LocalAuthoritySearch();
//debugger;
if (currURL && currLayerId && currField) {
//addLayertoMap(currURL, currLayerId, currField);
addFields(currURL, currLayerId, currField, currTOCid);
}
});
map.addLayer(baseMapServiceLayer);