简体   繁体   English

我无法弄清楚错误是什么,错误:未捕获的 ReferenceError

[英]I can't figure out what the error is, Error: Uncaught ReferenceError

I can't figure out what the error is (Error: Uncaught ReferenceError)我无法弄清楚错误是什么(错误:未捕获的引用错误)

(slidesWrapper = document.querySelector(wrapper)) - at slider (slidesWrapper = document.querySelector(wrapper)) - 在滑块处

  const slides = document.querySelectorAll(slide),
    slider = document.querySelector(container),
    prev = document.querySelector(prevArrow),
    next = document.querySelector(nextArrow),
    total = document.querySelector(totalCounter),
    current = document.querySelector(currentCounter);
  (slidesWrapper = document.querySelector(wrapper));
    (width = window.getComputedStyle(slidesWrapper).width);
    (slideField = document.querySelector(field));

The data is exported to another document数据导出到另一个文档

Uncaught ReferenceError: slidesWrapper is not defined未捕获的 ReferenceError:slidesWrapper 未定义

slider({
    container: ".offer__slider",
    slide: ".offer__slide",
    nextArrow: ".offer__slider-next",
    prevArrow: ".offer__slider-prev",
    totalCounter: "#total",
    currentCounter: "#current",
    wrapper: ".offer__slider-wrapper",
    field: ".offer__slider-inner"
  });




  

You are defining multiple variables with a single const where each variable is seperated by a comma.您正在使用单个const定义多个变量,其中每个变量由逗号分隔。

This is what the code should be:代码应该是这样的:

const slides = document.querySelectorAll(slide),
    slider = document.querySelector(container),
    prev = document.querySelector(prevArrow),
    next = document.querySelector(nextArrow),
    total = document.querySelector(totalCounter),
    current = document.querySelector(currentCounter,
    slidesWrapper = document.querySelector(wrapper),
    width = window.getComputedStyle(slidesWrapper).width,
    slideField = document.querySelector(field);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WordPress jQuery未捕获的参考错误(无法解决) - WordPress jQuery Uncaught Reference Error (can't figure it out) 我的代码中不断出现“未捕获范围”错误,我不知道为什么 - I keep getting an 'uncaught range' error in my code and I can't figure out why 在我不知道的p5.js草图中出现“未捕获类型错误” - Getting 'Uncaught type error' in a p5.js sketch that I can't figure out 我正在尝试创建XML和XSL,但它给我一个错误,我不知道该怎么办 - I am trying to create an XML and XSL, but it is giving me an error that I can't figure out what to do jQuery中的错误由于某种原因,我不知道为什么 - ERROR in jQuery for some reason and I can't figure out why 将 eact-chartjs-2 升级到较新版本后,我不断收到 Typescript 错误。 无法弄清楚错误的含义 - I keep getting a Typescript error after upgrading eact-chartjs-2 to a newer version. Can't figure out what the error means 无法找出此语法错误在哪里 - Can't figure out where this syntax error is angularjs-面临错误-无法解决 - angularjs - facing error - can't figure it out 我如何修复错误 Uncaught ReferenceError: addEvent is not defined - How can i fix the error Uncaught ReferenceError: addEvent is not defined 我不知道为什么会出现 ReferenceError: fileUploaded is not defined - I can't figure out why I'm getting a ReferenceError: fileUploaded is not defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM