Skip to content

Commit ec53cb6

Browse files
committed
Updating iFrame resizer example to arrow functions
1 parent 33350a9 commit ec53cb6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/includes/_samples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The sample code here is provided as a starting point for how to accomplish tasks
99
```javascript
1010
document.body.style.overflow = 'hidden';
1111

12-
function sendResizeMessage() {
12+
let sendResizeMessage = () => {
1313
window.parent.postMessage({
1414
type: 'IFRAME_HEIGHT_RESIZE',
1515
target: 'test-integration-iframe', // Note: Replace 'test-integration-frame' with your actual iframe identifier.
@@ -28,17 +28,17 @@ if (window.ResizeObserver) {
2828
> Integration Code:
2929
3030
```javascript
31-
(function (WIAPI) {
31+
(WIAPI => {
3232
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
3333

34-
API.insert('content', function (elem, meta) {
34+
API.insert('content', (elem, meta) => {
3535
const iframeElem = document.createElement('iframe');
3636
iframeElem.src = 'https://www.yourdomain.com/path-to-iframe.htm';
3737
iframeElem.classList.add('test-integration-iframe'); // Note: Replace 'test-integration-frame' with your actual iframe identifier.
3838
API.append(elem, iframeElem);
3939
});
4040

41-
function setIframeHeight(e) {
41+
let setIframeHeight = (e) => {
4242
if (e.origin !== 'https://www.yourdomain.com') {
4343
// You should ALWAYS verify the origin matches the third party domain
4444
// the iframe is loaded from. For more information, see:

0 commit comments

Comments
 (0)