function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JD1968JD1968 

Iframe in VisualForce page - Google not displaying

I'm trying to embed an iFrame in a VisualForce page for a Google Maps mashup.  For some reason anything from google.com is not displaying.  Any other domain seems ok.  The code below is a simplified version.  I'd be very grateful for any advice, thanks, John

 

<apex:page>

<!-- this works-->
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
src="http://www.bing.com">
</iframe><br />

<!-- this doesn't work-->
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
src="http://www.google.com">
</iframe><br />

</apex:page>

Best Answer chosen by Admin (Salesforce Developers) 
Chamil MadusankaChamil Madusanka

Try this example

 

http://www.techsahre.blogspot.com/2011/04/sfgmap-salesforce-google-map-jquery.html

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

All Answers

Chamil MadusankaChamil Madusanka

Google uses the X-Frame-Options: SAMEORIGIN header to block the site displaying in iframes. The X-FRAME-Options header is a security feature to prevent click-jacking attacks.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

JD1968JD1968

Thanks Chamil, I see.  In that case, how does one embed a Google map - all the examples I have see have been with IFrames?

Chamil MadusankaChamil Madusanka

Try this example

 

http://www.techsahre.blogspot.com/2011/04/sfgmap-salesforce-google-map-jquery.html

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

This was selected as the best answer
JD1968JD1968

Thanks Chamil - that is great