Hi,
Our Web site programming guidelines do not allow to load Javascript libraries in the <head></head> section. Our guidelines, for page loading optimization and user comfort purposes, ask to load them immediately before the closing </body> tag. Then we use an "onload" handler to run any Javascript code that must be done once the page is loaded.
I have tried this with the ShareThis API but for some reason, when the ShareThis widget javascript code is placed outside <head></head>, a button is always rendered, even without creating a Shared Object. The widget code seems smart and detect whether it in <head></head> and does not render any button in this case...
Is there a parameter I can pass in the widget javascript code so that no button is rendered, even if the code is outside <head></head>?
Example of what I'd like to do:
<html>
<head></head>
<script>
function onload() {
var obj = SHARETHIS.addEntry( ... );
var el = document.getElementById( "mydiv" );
obj.addButton( el );
}
</script>
<body onload="onload">
...
<div id="mydiv"><a href="javascript:void(0)">Share This</a></div>
...
<script src="http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail(...snip...)"></script>
</body>
</html>
As is, it does not work: a button is rendered at the end of my body.
Thanks for you help. ShareThis is a fantastic widget!
--Mikael
