Omar Shamali

ShareThis Platform On Load JS Listener

Author: Omar Shamali
Last Modification:
Writing Date:

So ShareThis developers has made this great tool for plug n play sharing options out of the box, you just:

  1. Create an account. 
  2. Add a property (domain). 
  3. Copy and paste the code they provide. 
  4. Click activate ,
  5. Choose style like inline-sharing. 
  6. and that is simply it!

Now, when it comes to development of a website or web applications, we would do execute some code upon the even of something else, in this case, I want to execute a specific code when the ShareThis FINISHED loading, so I digged online, but no luck, I had to open the JS file they provide, and I discovered they have put a function that fires if exists, and they call it: onShareThisLoaded.

Now, the rest is quite straight forward, just have this function in any part of the code of the website, and do whatever you need:

function onShareThisLoaded(){
	console.log("lovely discovery, yet I maybe missed some documentation on their website?! I dont know");
}