- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 10:00 PM
Hi all,
I've got a popup modal that is generated by a catalog client script, everything is working except I can't find the syntax to get the redirect to open in a new browser tab. Anyone know what I'm missing? thanks!
Here's the script that opens the modal with the "location.href" that I'm using for now for the redirect...I'm assuming this is not correct. I've added target="_blank";
spModal.open({
title: 'Issue?',
message: 'To report an issue, you need to use a different form in our ESS portal. <p><p>Click the button below to redirect to the correct form.',
buttons: [
{label:'Take me to the correct form', primary: true},
{label:'Stay on this page', cancel: true}
]
}).then(function(){
//populates the "u_practice" field when the cat item opens in ESS portal
location.href='ess/main_content.do?sysparm_content_url=com.glideapp.servicecatalog_cat_item_view.do%3fsysparm_id%3d3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_variables={"u_practice":"34ec3caedbd883006e4d778ebf96198d"}';//this is what I want to open in new tab
target="_blank"; //this does not work
});
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2019 03:31 PM
Hi Patrick,
Window may not be available but top is:
var url = "//your.url.here";
...
top.window.open(url, '_blank');
...
Give that a try. It might work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 07:41 AM
Hi Patrick,
Not sure on that part; I think you will have to try it out in some way
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2019 09:13 AM
Thanks Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2019 10:33 AM
Hi Patrick,
Can you also mark answer as ✅ correct, 👍 helpful if you were able to achieve the requirement and then close the thread.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2019 03:31 PM
Hi Patrick,
Window may not be available but top is:
var url = "//your.url.here";
...
top.window.open(url, '_blank');
...
Give that a try. It might work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2019 10:25 AM
You are the man Chris! that's it...thanks! Hope you've been well.