在JS脚本中,Edge引发错误5002对象字段声明上应有的功能

时间:2019-04-24 07:03:55

标签: javascript microsoft-edge

在相当简单的HTML页面中,我添加了脚本。这与FF和Chrome完美搭配,不适用于Edge或IE。虽然IE问题我可以忍受一段时间,但我宁愿为Edge找到解决方案。 边缘在那条线上抛出引用的错误  pageQueryInput: document.getElementById('pageQueryInput'),

整个代码都是这样的:



function renderBooks(){
console.log('render');
console.log(document.getElementById('booksContainer'));
console.log(document.getElementById('pageQueryInput'));
// myPage  creates variable storing some important nodes that are built with HTML (and not rendered by this function )and therefore can be determined immy after load event
const myPage ={ 
    booksContainer: document.getElementById('booksContainer'),
    pageQueryInput: document.getElementById('pageQueryInput'),
    radio:  [...(document.getElementById('radioInputs')).getElementsByTagName('input')],//xxxxxxxxxx
    noBooksScreen: document.getElementById('noBooksModal'),
    noBooksScreenContent: document.getElementById('noBooksModal-content'),
    noBooksScreenCloseButton: document.getElementById('closeNoBooksScreen'),
    form: document.getElementById('queryForm'),
    resetButton: document.getElementById('resetButton'),
    }```

That is just beginning of the function so the main brace is not locked. The code is more than simply. I have found some similar questions but none of such the simply case. Could someone have a look?

0 个答案:

没有答案