How to open html code in iframe or new page?

Gowri S
Tera Expert

From UI action, we have outbound API call to external system as response they are sending html code and it has to be opened in iframe or new page, it will be external page not ServiceNow page.

 

I am receiving the HTML code, now I am not sure how to open it in new page or iframe. Kindly let me know if this is possible.

 

Thanks Gowri

1 ACCEPTED SOLUTION

Gowri S
Tera Expert

The solution to open in new page using window.open with form hidden inputs as similar to below Reference

 javascript - Window.open and pass parameters by post method - Stack Overflow

View solution in original post

16 REPLIES 16

Thanks a lot @Prince Arora, I have implemented as per your suggestion, I am waiting to get a proper response from external system to see whether it will really work as per the requirement. 

 

Requirement is to open the response html code in iframe or new page, from there user should allow to make an appointment to the external system. 

 

I will keep you updated on this post.

Hi @Prince Arora,

 

I am getting proper XML in the API response body, but when I pass the same to renderWithContent, I still see the blank popup. Could you please suggest?

Thanks

@Gowri S 

 

We need HTML content to be rendered instead of XML

Could you please share you content here what you got as response

@Prince Arora,

 

Sorry, the response is HTML content only, but it need Javascript to run it.  Is there a way? Could you please suggest?

 

Thanks,

Gowri

@Prince Arora,

 

We will get the below html code in the API response. This has to be open in popup window or new page.

Gowri5_0-1682574416585.png

 

Kindly let me know if this is possible?