- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 11:19 AM
I'm working on integrating the OneReach chatbot in our service portal , and to do so I need to create a script with the async and id properties in it
<script
id="rwc-embed-script"
async
src="https://chat.something-staging.onereach.ai/lib/richWebChat.umd.min.js"
></script>
but on creating a UI script these properties are not available , is there a way I can create it ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 03:50 PM
Out of the box servicenow does not support asynchronous scripting in ui script. So i dont know if it will work, especially not with embedded and external sources. But you can try:
var script = document.createElement('script');
script.id = "rwc-embed-script";
script.async = true;
script.src="https://chat.something-staging.onereach.ai/lib/richWebChat.umd.min.js";
document.head.appendChild(script);
script.onload = function() {
console.log("Script loaded successfully.");
};
script.onerror = function() {
console.error("Failed to load the external script.");
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 03:50 PM
Out of the box servicenow does not support asynchronous scripting in ui script. So i dont know if it will work, especially not with embedded and external sources. But you can try:
var script = document.createElement('script');
script.id = "rwc-embed-script";
script.async = true;
script.src="https://chat.something-staging.onereach.ai/lib/richWebChat.umd.min.js";
document.head.appendChild(script);
script.onload = function() {
console.log("Script loaded successfully.");
};
script.onerror = function() {
console.error("Failed to load the external script.");
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2024 10:47 AM
Yeah I tried something similar, but haven't made it work