Why FXM should wait for your page to load

Context

Working with FXM, I faced a very interesting sporadic issue: every 10-15 times some of the components were not loading on a page. A response object was identical all the time, no errors in console, no changes in a site code since the last deployments. I think you get the situation.

However, this issue was able to cause a lot of troubles for a client as FXM was used on many legacy sites. So I continued digging…

Continue reading “Why FXM should wait for your page to load”

Why FXM should wait for your page to load

$(document).ready() for Sitecore FXM

CONTEXT

Federated Experience Manager (FXM) is a marketing tool from Sitecore, that allows you to use components defined in your WCM on other site and application. This is very useful if you ned to update multiple legacy applications or try some part of a new design on an existing site.

As most of other similar tools, Sitecore provides you with a JavaScript beacon that has to be included in a target site. It would call Sitecore and do all magic on the page related to an inclusion of HTML snippets into a page. Sounds easy, but what if you have really rich UI components or using front-end frameworks like jQuery or Angular. In this case, you need to make sure that you reinitialize embedded javascript correctly after FXM delivered all HTML to your page.

There should be something similar to $(document).ready()

Continue reading “$(document).ready() for Sitecore FXM”

$(document).ready() for Sitecore FXM