In this code:
http://twitter.com/javascripts/widgets/widget.js

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
tutorial."

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
document.write.

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

Thanks for listening.

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to