What mbox.js does

Information to help your technical staff understand the mbox.js implementation and how it might affect your site.

IMPORTANT

mbox.js end-of-life: As of March 31, 2021, Adobe Target no longer supports the mbox.js library. Post March 31, 2021, all calls made from mbox.js will gracefully fail and impact your pages that have Target activities running by serving default content.

We recommend that all customers migrate to the most recent version of the new Adobe Experience Platform Web SDK or the at.js JavaScript library before this date to avoid any potential issues with your sites. For more information, see Overview: implement Target for client-side web.

Target Standard requires mbox.js version 58 or later. For instructions on how to download and update mbox.js, see Mbox Implementation.

For Target Standard, mbox.js calls another JavaScript file, target.js. Target.js is hosted by Adobe and is automatically updated by Adobe. There is nothing you need to do to update target.js, and there are no client-specific customizations.

Target.js creates an mbox called target-global-mbox in the <head> section of your page.

Target.js is called from mbox.js by a line of JavaScript code added to the Extra JavaScript field in mbox.js. The only way to disable target.js is not to include this line of code, thus also disabling Target.

Target.js has two functions in Target:

  • DOM manipulation
  • Enables visual elements of the Visual Experience Composer

DOM Manipulation

Target.js controls the DOM manipulation library used by Standard. To display the content of a website, target.js references sizzle.js (version1.10.8-pre). Sizzle.js enables the HTML element selectors. Other than sizzle.js, only native JavaScript is used. No jquery is required.

In addition, the following snippet is used for polling the DOM:
https://github.com/dperini/ContentLoaded

Target.js and the Visual Experience Composer

When you use the Visual Experience Composer to set up an experience for an activity, your web page is opened in an iFrame. When the iFrame is loaded, Standard sends an HTML5 postMessage API call. Target.js detects any postMessage calls and includes the following JavaScript libraries on the website:

  • For thumbnail generation: https://html2canvas.hertzen.com/
  • For cross-domain query: Admin.js, CDQ.base.js, CDQ.host.js, admin.css, used to send messages across the iFrames. These scripts allow Adobe to send data between the pages.

Considerations for Angular Sites and Single-Page Applications

If you are implementing Target in an Angular site or in any Single-Page Application (SPA), you should use the at.js library instead of mbox.js.

For more information, see at.js Implementation.

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now