AmazonShareThis is one of the most popular widgets that you can use to make your website social. However if you are trying to install the ShareThis widget on your site you may get the following error when testing on your local web server:
"Uncaught TypeError: Cannot read property 'length' of undefined" produced by http://s.sharethis.com/loader.js
If you expand the errors in Chrome's web developer toolbar console you may see the following trace.
Uncaught TypeError: Cannot read property 'clientHeight' of null
Uncaught TypeError: Cannot read property 'length' of undefined
If you use Firefox you may see the following error.
TypeError: f.document.body is null jquery.min.js (line 166)
Read on to see how to solve this issue.
The Root Cause
If you get the "Cannot read property 'length' of undefined" error or "TypeError: f.document.body is null" error caused by jquery.min.js it's possibly due to the fact your DOM is not ready before jquery tries to manipulate it.
Knowing the root cause you can simply use a domain with at least one dot within it. For example try http://127.0.0.1 and hopefully you'll see the ShareThis widget showing up!
Questions? Let me know!