In this code:

You are using document.write() to create the widget element. Bad bad
bad. Any AJAX site that tries to init the widget after the page loads
will have the entire page overwritten by the widget.

W3C even has this to say about document.write():
"Note: Try to avoid using document.write() in real life JavaScript
code. The entire HTML page will be overwritten if document.write() is
used inside a function, or after the page is loaded. However,
document.write() is an easy way to demonstrate JavaScript output in a

So, I downloaded the JS file and modified TWTR.Widget to take a
container element name as part of the options object. If
set, .innerHTML is used on the container element instead of

This simple fix will make your widgets compatible with Web 2.0 sites.

Thanks for listening.

Twitter developer documentation and resources:
API updates via Twitter:
Issues/Enhancements Tracker:
Change your membership to this group:

Reply via email to