AddToAny Blog

Posts Tagged ‘api’

New menu API, examples, documentation

Wednesday, February 10th, 2010

Over the past couple weeks we have been rolling out a new sharing menu API for AddToAny.  Our primary goal was to make AddToAny self-contained while maintaining perfect backwards compatibility with our old API.

What’s new?

Essentially, the new API is just a new syntax for customizing AddToAny, though we have exposed a few new customizations and techniques that you’re welcome to try out.

What’s changed?

Aside from the optional new syntax, most of the changes are under the hood.  Instead of configuring AddToAny using global variables, which in theory could collide with other global variables, you can now configure AddToAny under one self-contained object, a2a_config.  Additionally, the single object method offers a slight speed gain in modern browsers, and occasionally a noticeable difference in older A-Grade browsers on JavaScript-heavy pages.  Speaking of which, AddToAny’s intensive support for all A-Grade browsers (and more) continues with our long held believe that sharing should be quick and easy for as many devices and user-agents as possible, both old and cutting edge.

Transitioning to the new API

While transitioning to the new API is optional at this point, there are some important aspects to note.

  • All transitioned properties take the same name as their legacy global counterparts
  • Future properties will not have a supported global equivalent
  • Be careful with syntax and handling of the a2a_config object
  • Definitely check out the thorough examples and documentation, and list of available properties

If you have any questions or run into any problems at all, feel free to get in touch with us directly.  Happy early Valentine’s Day!