Question
Iriz Consulting
FR
Last activity: 25 Jan 2017 4:57 EST
iFrame remains empty
Hi,
I'm trying to use a control containing an iFrame. However, the iFrame remains empty... I tried the following code in a custom html control:
<iframe style="width:100%; height:100%;" id="myFrame" name="myFrame" src="http://www.w3schools.com">
</iframe>
I also tried with an html section, but with the same result: my iFrame is still empty. For some reasons, I can't use the Live Ui in that screen as well.
How can I get my iFrame to work? Thanks in advance.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
EPAM Systems, Inc.
ES
Hi Thomas,
At first place, kindly check the valid certificate is available or not?
Changes made:-
1. Add the URL in the trusted site.
2. Display mixed content
Refer this post for details:- https://collaborate.pega.com/question/launching-url-iframe-pop
Alternatively, try using below script :-
<frameset name="" id="" >
<script>
var windowUrl = window.location.href;
var headUrl = windowUrl.split("?")[0] + "?";
var contentUrlSite = "pyActivity=CLASSNAME.ACTIVITYNAME";
var iframeSite = "<iframe id='YOURIFRAMEID' name='YOURIFRAMENAME' src='"+headUrl+contentUrlSite+"' width='' height='500px' frameborder='0' scrolling='yes' />";
document.write(iframeSite);
</script>
</frameset>
Kindly notify, if it helps.
Regards,
Asif
EPAM Systems, Inc.
ES
This also may help you :- https://collaborate.pega.com/question/anyone-else-having-issue-ie-11-and-pega-7-were-not-able-load-pega-7-iframe-within-portal
Pegasystems Inc.
IN
Hello,
Please follow the below steps to use iframe.
Step One : Create a Section
Step Two : Edit the section and uncheck the auto generate HTML box so it is manually generated HTML
Step Three : Paste in a snippet for an iframe. This can be any directly accessible content on the web.
<iframe id="myFrame" name="myFrame" src="<your_request_url>" scrolling='no' height='150' frameborder='0' marginwidth=0 marginheight=0 > </iframe>
for example :-
<iframe id="dow" name="dow" scrolling="no" style="border:none; overflow: hidden; height:200px; width:210px;" src="http://ichart.yahoo.com/v?s=^DJI"></iframe>
Hope this helps. Let us know your observations.
Best Regards,
Mounika
Iriz Consulting
FR
Hi,
Thanks for all your replies.
@ AsifHasan, your solution was working. It was however only working with IE, so I tried to fix it with the other browsers without success.
I tried to change the format of the containing layout, and then get back to cancel the changes. And for some reasons, the iFrame is not working anymore, not even with IE...
My logs are empty and the only information I have from the developper console is "Failed to load resource: the server responded with a status of 400 (Mauvaise Requête)". But the ressource is just a confirmation .gif.
EPAM Systems, Inc.
ES
Hi Thomas,
Thanks for your update.
So, you mean to say even after discarding the changes and making code as it was suggested fails to load iFrame?
On further enquiring on web, I found that iFrame has a estranged relationship with browsers specifically Chrome.
There are multiple issue related with authentication of iFrame in Chrome specially when "https" is used.
Refer :- http://www.projectinsight.net/support/kb/chrome-blocks-iframe
and issue reported with Chrome support :- https://productforums.google.com/forum/#!topic/chrome/e3eRJy3vXSM
400 (Mauvaise Requête) means bad request. Please refer this article, it content detail probable reason and solution as well :- https://www.lifewire.com/how-to-fix-a-400-bad-request-error-2617988
Regards,
Asif
Iriz Consulting
FR
I successfully managed to get my iFrame to work again, but it works only with IE.
With Chrome and Mozilla Firefox, I'm having the following error message:
"Refused to frame '(my link)' because it violates the following Content Security Policy directive: "frame-src 'self'"."
As the link and my environment are both in trusted sites, I guess the problem is concerning the compatibility between Pega and the browser, which can mean that it could cause some security issues on the future. I'll try a different approach for my problem.
Thanks for your answers.