Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Is it possible to provide iframe in spModal?

Sathwik1
Tera Expert

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?
        });
     }
};

 

@Mohith Devatte @Ankur Bawiskar  In PopUp I need to show w3schools website

16 REPLIES 16

find_real_file.png

okay window pop up is coming up but i think iframe src has got the issue 

can you send the widget code ?where you gave the iframe

I used iframe as www.google.com..

in console I can see this error.. may be servicenow is not supporting iframes?

Error in console : Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

@Mohith Devatte 

try giving another URL once like your instance homepage url and see

mark sure the syntax is <iframe src="your url"/>

Yeah, I tried that...

If I give same page like instance home page.. then it is working.