首页 > 解决方案 > 在 VSlint 中没有显示错误?

问题描述

我正在使用 VS Lint,但代码无法按我的需要运行。

谁能提供一些关于我的脚本标签应该是什么样子的建议?

就上下文而言,这个脚本出现在我的表单之后。

async function onFormSubmit(ev) {
    ev.preventDefault();
    const EL_form = ev.currentTarget;
    return (await fetch(EL_form.action)).json();
}
                                  
const ELS_form = document.getElementByID('element');

ELS_form.forEach((el) => 
    el.addEventListener("submit", (ev) => {
        onFormSubmit(
            const response = await fetch("/lookup/" + 'user input')
              .then(result =>result.json())
              .then(res => console.log(res));
    })
); 

标签: javascript

解决方案


推荐阅读