2

I have a VisualForce Page with 2 page links and an iFrame. The 2 links are above my iFrame and I want to have the iFrame view these 2 different pages when clicked. This works the way I want it to in Classic but not in Lightning. When this is viewed in Lightning it just opens the 2 differet URLs in New Tabs on my browser... it does not keep the redirect in the iFrame. I have posted the code below... Please Help!

<apex:page >
<br />
<a href="https://www.google.com/DesktopTraining.html" target="Test1">Desktop Training</a>

<br />
<a href="https://www.google.com/MobileTraining.html" target="Test1">Mobile Training</a>

<iframe
src="https://www.google.com/DesktopTraining.html" width="100%" height="1610" scroll="yes" name="Test1">
</iframe>

</apex:page>
3
  • When you use a Visualforce page in a Lightning component it gets iframed in. So your iframe named "Test1" is actually inside another iframe. Source. I suspect you would need to rework your target attribute to correctly address the iframe. Commented Aug 17, 2016 at 2:39
  • I love the #TrailHead link in your answer... thats awesome! Unfortunately I personally have not worked with nested iframes in the past... this is actually my second iFrame ever and only my thrid or fourth VisualForce page ever. Do you or anyone else on here have a more in depth descripton of how I can fix my code so that my VisualForce Page showins in my Tab in the Lightning experience just like it oes in Classic? Commented Aug 17, 2016 at 20:37
  • I'm not 100% sure why it isn't working. I can confirm that the same thing is happening for me. At first I thought it might have been something that the new Locker Service was inflicting on us. However, I turned that off and it is still happening. Commented Aug 18, 2016 at 0:52

0

You must log in to answer this question.

Browse other questions tagged .