Detect when Landing Page is fully loaded

145 Views Asked by At

I'm trying to do some processing once a Marketo Landing Page is fully loaded: specifically, equalizing the heights of text elements.

I can do this successfully if there's a form loading, by executing it on 'whenReady'... but if there's no form on the page, is there a way to set up a callback when Marketo has finished initializing? (e.g. all mktoText elements are ready and set)

1

There are 1 best solutions below

0
On BEST ANSWER

This won't win any prizes, but I've solved the problem by adding a hidden Marketo Form to the page, and using loadForm to guarantee that whenReady is called:

<div style='display:none'><form id="mktoForm_..."></form></div>

I dislike this sort of hack (in fact, I can't convince myself it's full-proof: what if the form loads before text processing is done?)... I'd still love to hear a more elegant solution!