HI all,
I would like to integrate a calendar widget from another Cloud application in which appointments can be made. I have a reactive web app and to do this, I need to include an external js file with data attributes somewhere between the <body> tags. According to the documentation of the widget I need to include a <script> tag with attributes like data-apikey and data-configuration. How do I include a js file with data attributes?
Because of the data attributes I think importing the js file is not an option. Because my app is a RWA there is no expression with the escaping content option. I've tried some other options I found on the forum but each time I'm running into the problem of passing the data attributes.
Can't imagine this can't be done. I'm probably doing something wrong here. Can anyone please help me out? Thanks in advance.
Hi Ramon,
You can use some think like below
script.setAttribute("data-apikey", "XXXXXXXXXXXX");
Best Regards
Devendra Baghel
Devendra Baghel wrote:
Works like a charm! Thanks Devendra!
You can add JavaScript file in react web app by Adding a javascript block and adding a javascript file in body by using javascript code same as in attached image
Devendra
Thanks for your answer Devendra. I've tried that, but how do I pass the data attributes? The aren't part of the src and if I add script.data-apikey I get an error. Any ideas?