- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 07:45 PM
Hi Everyone,
I want to call external JS library in UI page. How can I call below JS library ?
JS library - "https://cdn.jsdelivr.net/npm/jsframe.js/lib/jsframe.min.js".
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 08:14 PM
Hi @Abhijit Das7 ,
You need to store JS library in UI scripts. Then call it from UI Scripts.
Sample :
var UI=document.createElement('script');
UI.src="file_name.js";
document.body.appendChild(UI);
Please refer to the blog : https://john-james-andersen.com/blog/service-now/linking-several-javascript-libraries-servicenow-ui-...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 08:14 PM
Hi @Abhijit Das7 ,
You need to store JS library in UI scripts. Then call it from UI Scripts.
Sample :
var UI=document.createElement('script');
UI.src="file_name.js";
document.body.appendChild(UI);
Please refer to the blog : https://john-james-andersen.com/blog/service-now/linking-several-javascript-libraries-servicenow-ui-...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 08:48 PM - edited 07-03-2024 08:48 PM
Hi @Community Alums
UI Script :
UI Page:
HTML
<!-- <?xml version="1.0" encoding="utf-8" ?> -->
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide">
<div style = "width:600px; height: 450px; border: 1px solid">
<!--<script src="https://cdn.jsdelivr.net/npm/jsframe.js/lib/jsframe.min.js"></script>-->
<g:requires name="global.myUIscript.jsdbx" />
<input type="button" style= "background: blue; color: white ; border-radius: 1px; padding: 10px 22px; font-size: 16px; font: Sans-serif" value="OPEN" onclick="openepgp()"/>
</div>
</j:jelly>
CLIENT SCRIPT
function openepgp() {
var jsFrame = new JSFrame();
var frame01 = jsFrame.create({
title: 'Window1',
left: 20,
top: 20,
width: 320,
height: 160,
url: 'www.google.com', //URL to display in iframe
//urlLoaded:Callback function called after loading iframe
//urlLoaded: (frame) => {
//Called when the url finishes loading
//}
});
frame01.show();
}
We want to use JS Frame to resize pop up.
Thanks .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 08:53 PM
Hi @Abhijit Das7 ,
Now, it's a different ask @Abhijit Das7 . i think your original question was for on calling the JS libraries and now what you are asking is a use case. Please raise another question in the community and close this thread.