Migrate from mbox.js to at.js
The at.js library is a new implementation library for Adobe Target designed for both typical web implementations and single-page applications.
Among other benefits, at.js improves page-load times for web implementations and provides better implementation options for single-page applications.
at.js replaces mbox.js for Target implementations. The at.js library also includes the components that were included in target.js, so there is no longer a call to target.js.
To use at.js, replace the mbox.js reference on pages where you want to implement it. You cannot use both mbox.js and at.js on a single page. However, you can use either on each page on your site.
The at.js library works for existing implementations using the mboxCreate(), mboxDefine(), and mboxUpdate() functions and supports new functionality focused on single-page-app based implementations.
You can use at.js anywhere you currently use mbox.js.
The at.js library offers several improvements over the mbox.js library, including:
- Completely asynchronous communication via cross domain AJAXAlthough at.js communicates with the Target servers asynchronously, the at.js file itself must load synchronously in the <head> section of your page. Ideally, it should be one of the first scripts loaded. Once loaded, at.js executes mbox calls asynchronously through XMLHttpRequest, and does not block page rendering.
- No more blocking calls
- No document.write() used
- Better timeout and error handling
- Customizable timeout per call
- No reloads on timeouts
- Functions designed specifically for single-page apps/MVC frameworks
Training video: at.js - Advantages and Implementation Best Practices
This video is a recording of " Office Hours," an initiative led by the Adobe Customer Care team.
- How the at.js library works
- The advantages of at.js over mbox.js
- How at.js manages flicker
- Error handling in at.js
- Debugging methodologies
- Known issues and future roadmap