Mbox Content dynamic HTML JS not initial issue

ngs11945101 15-01-2019

Hi, All.

I am using mbox to create dynamic page content,

But when my mbox content is rendered into my dom, my mbox content js function is not running (for instance in the mbox content I have slider, form validation and etc components).

So I added the following code to make sure my core, components, modules js run after the mbox content is completely rendered in the dom.

But this code is only running once, which when I refresh the page the second time, the following code is not running anymore.

I did try to remove "mbox" cookies and refresh the page again, then the following code is running again.

Do you have any idea of this?

doc.addEventListener(adobe.target.event.REQUEST_SUCCEEDED,

  function(e) {

  console.log('external content get request succeeded', e);

  doc.addEventListener(adobe.target.event.CONTENT_RENDERING_SUCCEEDED,

    function(e) {

    components.init();

    core.init();

    console.log('external content get render succeeded', e);

  });

  doc.addEventListener(adobe.target.event.CONTENT_RENDERING_FAILED,

    function(e) {

    components.init();

    core.init();

    console.log('external content get render failed', e);

  });

});

doc.addEventListener(adobe.target.event.REQUEST_FAILED,

  function(e) {

  components.init();

  core.init();

  console.log('external content get request failed', e);

});

Accepted Solutions (0)

Answers (0)