- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 06:28 AM
Hello everyone,
I want to display the current URL of my Servicenow's instance form an UI Page using javascript and jelly. Can I have some script example to do this ?
Exist another way to display this current URL in a alert dialog ?
Thanks in advance,
Carole
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 06:37 AM
It could be as simple as this:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
alert(window.location.href);
</script>
</j:jelly>
What is the requirement here? Do you want to use that URL somewhere else on the UI page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 06:36 AM
HI
You can create a UI action.
Use the following:
var gURL = new GlideURL();
gURL.setFromCurrent();
// you can get params by doing the following
var param = gURL.getParam("parameter_in_url");
Refer : https://community.servicenow.com/community?id=community_question&sys_id=e61dec0adb600c10190dfb2439961959
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 06:37 AM
It could be as simple as this:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
alert(window.location.href);
</script>
</j:jelly>
What is the requirement here? Do you want to use that URL somewhere else on the UI page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 09:48 AM
I want to display that URL from a catalog custom variable.