- Accounts and users
- Direct Messages
- Publisher tools & SDKs
- Twitter for Websites
- Developer utilities
- API reference index
Initializing embedded content after a page has loaded
If content is dynamically inserted into a page (such as lazy-loading content or using a pushState technique to navigate between articles) it’s necessary to parse new buttons and widgets using the twttr.widgets.load() function.
Called without argument, widgets-js will search the entire document.body DOM tree for uninitialized widgets. For better performance, pass an HTMLElement object to restrict the search only to children of the element.
twttr.widgets.load( document.getElementById("container") );