I am working on a page built in React but also calls a coldfusion cfc page to display a grid. The grid HTML is generated in a cfc and then just placed on the page. This HTML and JS works just fine. Within the grid there is a button and onClick, it opens a modal (also generated HTML/JS from the same cfc) the modal opens fine and the HTML displays correctly on the page but the JS doesn't make it on the page. I'm at a loss on how to get the JS added to the page.
I am just generating an HTML string in a cfc and then appending the js to it. My assumption is I need to do something on the React end of things to have the js display on the page. I am new to React and new to working with coldfusion and React.
Happy to share some code if it's helpful but there is quite a bit of course so not sure exactly what to share. Thank you!
Wanted to update this in case anyone else runs into this issue. What ended up working for me was to create only the HTML in the cfc and append to the page. Then, in my React code, i appended an external js file.
componentDidUpdate(
let externalScript2 = document.createElement("script");
externalScript2.type = "text/javascript";
externalScript2.src = 'js/externalJSFile.js';
gridContainer.appendChild(externalScript2);
)