I am working on customizing the chatbot functionality for my website built with Nuxt.js. I want the chatbot to display on certain pages while remaining hidden on others. Unfortunately, I encountered an issue when trying to hide it on specific pages.
To implement the chatbot, I included script tags in app.html. For the pages where I do not want the chatbot to appear, I tried using the following code within mounted:
var element = document.getElementsByClassName("fc_frame")
element.classList.add("d-none");
However, this resulted in a 500 error and the console displayed:
TypeError: Cannot read properties of undefined (reading 'add')
Do you have any suggestions for resolving this error?