Iframe not loading for some users

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
I have an iframe within a template that goes to a visualforce page.  For some users, the iframe loads but for others the iframe doesn't work - infact the iframe will work if a different user logs into the same computer that the previous user was having display problems with.  Conversely, the same user can login to a different computer and see the iframe.  

<iframe src="https://crms14.eu1.visual.force.com/apex/rdAccount?&isdtp=vw&id={{{$Param.id}}}"; width="100%" height="275px" seamless="seamless" show-header="false" scrolling="yes" frameborder="0"/>

I cannot for the life of my work out why those specific users cannot see the iframe.  
Photo of Chris Mollan

Chris Mollan

  • 570 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I believe you have to give permission to each profile to view each VIsual Force Page. It sounds like there is a profile that you have not given permission to view that VF page. Are all the effected users using the same profile?
Photo of Chris Mollan

Chris Mollan

  • 570 Points 500 badge 2x thumb
No, the affected users are on different profiles - bizarrely, those problem profiles can see the iframe if they use a different pc.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
So it is only for specific users on a specific PC? Did you try a different browser. The only thing I can think of is that it is a caching issues. I would try to clear the cache on the browser on the problem computer.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Shot in the dark, but does your iframe actually have a semicolon in it after the src attribute? It shouldn't --- but this could of course just be a copy-paste error.

<iframe src="https://crms14.eu1.visual.force.com/apex/rdAccount?&isdtp=vw&id={{{$Param.id}}}" width="100%" height="275px" seamless="seamless" show-header="false" scrolling="yes" frameborder="0"/>
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Also, I'd recommend relative URLs whenever possible to enable portability between Sandboxes / Production and to protect you against SFDC pod transitions, e.g. if you get switched from EU1 to EU6 or something like that, just make sure to prefix the VF Page name with the namespace it is included in, so your URL would be this instead:

/apex/crms14__rdAccount?&isdtp=vw&id={{{$Param.id}}}
Photo of Chris Mollan

Chris Mollan

  • 570 Points 500 badge 2x thumb
Great thanks, changing the URL seemed to do the trick.