Is it possible to provide iframe in spModal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 12:59 AM
In portal, I had a sentence.. when I clicked on it..a popUp needs to open ... in that I want to show some website.. ex: w3 schools website... so what should I need to write?
HTML
<div>
<p ng-click="c.clck()">Click here to open Popup</p>
</div>
Client controller
api.controller=function(spModal) {
/* widget controller */
var c = this;
c.clck= function () {
spModal.alert('How do you feel today?').then(function (answer) { // In this line what should I write?
});
}
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 01:05 AM
Hi,
You can refer to this thread :https://community.servicenow.com/community?id=community_question&sys_id=89bf4610db512c104aa5d9d96896...
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 01:10 AM
hey sathwik,
try this
Create a widget with <iframe> code and copy the ID of the widget
HTML:
HTML
<div>
<p ng-click="c.click()">Click here to open Popup</p>
</div>
Cope the id of the widget and give it in widget parameter like below
widget:"your_widget_id"
api.controller=function(spModal) {
/* widget controller */
var c = this;
c.click= function () {
spModal.open({
title: ''Your Title',
widget:"your_widget_id_where_iframe_is_present",
}).then(function(){
console.log('widget dismissed');
})
}
};
Hope this helps
Mark the answer correct if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 01:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 02:37 AM
can you attach the screen shot once again?
it is broken