IFrame "update the whole browser window" --> just immediate parent instead?

I have a YCBM iframe in my page, but my page is itself iframed into our partner’s page.

So if “A” = my partner’s page
and “B” is my iframe within A
and “C” is the YCBM iframe

…then when the user books a meeting, I want to redirect B to a new location, not A.

Is that possible?

Hi @TomK, I hope you are doing well.

Unfortunately not. We only have the 2 options inside the booking page settings:

update only the iframe (the child iframe or “C”)
or update the whole browser window (“A”).

There are ways with javascript to redirect only the direct parent with the “window.parent” property (or in html with a script tag and the “window.parent.location.href” property), but for that the child and parent need to be on the same domain, which is not the case.

Thank you much. I did find a way around it using my own JavaScript programming. I have the YCBM page go to a known fixed page on my side, with a query string value that I set. On that page it triggers the parent page, which is doubly easy because they are on the same domain, and the PostMessage command works without issue.

Hi @TomK! Whoa, that is a great workaround! :star_struck: And I’m glad you found something that made it work

Thank you. Yeah, it took a little fiddling to get it to work, and in fact, YCBM might want to use a trick like this as part of the basic design.

What I’m doing is putting a static HTML page on a static assets server we own, so that it can be called from any of my systems that uses YCBM. This static page simply contains this:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
   <script>
      window.onload = function() {
         window.parent.postMessage('YCBM:BOOKING_COMPLETE', '*');
      };
   </script>
</body>
</html>

I configure my YCBM booking page to redirect to this page once the booking is complete.

And I wire up my “parent” page to wait for this PostMessage payload. If it arrives, the user completed a booking, and I can proceed with their user-experience.

The nice thing is that this is agnostic. There’s no business-specific code in this page, it’s just a way to ping the parent page. It’s not transmitting any business data. (Though I suppose I could add query strings and include that in the payload if I wanted.)

So I could imagine (hint!) that YCBM could take this and implement it as a stripped-down feature. Just offer a page like mine, that calls the parent with some innocuous PostMessage data. Or get fancy, and load it up with the link to the meeting record or some other contextual data about the booking.

I just discovered by experimentation that I can add a query string like ?ref={REF} and it works!

Can I count on this working always? Or did I just wander off into the wilderness of unsupported features.

Do all the other { } placeholders work?

If you are able to get {REF} to work then other placeholders may work as well. You might need to {ENCODE}{NOTES}{ENCODE} if you are passing them through to make sure things are not breaking.