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
Gab SilvermotionGab Silvermotion 

Load html code or iFrame using buttons & onclick javascript?

Hello! We started using a booking solution and they have a bunch of way we can add this to our website and marketing emails and we did. I'd love to place that widget on my opportunity layout. is there a way to do this?

This is what the code looks like.: 
Website (HTML)
<img id="scheduling-12773625" src="" onclick="openScheduling(12773625)" style="cursor : pointer; border: 0"/> <script type="text/javascript">var scheduling = {server: '', button: '16065759', lang: 'en'};</script> <script type="text/javascript" src=""></script>

<iframe src="" frameborder="0" style="width: 750px; height: 510px; border: 0" marginwidth="0" scrolling="auto"></iframe>

The best practice way to include an external web site into Salesforce is via a canvas application, but if you don't own agendize you won't be able to make the required changes on their end.

What you can do is embed a Visualforce page in your opportunity layout that embeds the iframe the page itself can then use the apex:iframe tag. A very simple example of this is:
<apex:page standardcontroller="Opportunity">
  <apex:iframe src="" frameborder="0" width="750" height="510"/>

As this page uses the opportunity standard controller, you can add it to the page layout.