On my master page i have a tag cloud web part.

I use jquery to redirect tags to search center. I reference it in my master page:

<script type="text/javascript" src="/_layouts/project/js/addons.js"></script>

I tested the script with the console in firebug and it works like a charm. but it seems that the addons.js gets loaded before http://url/_vti_bin/SocialDataService.asmx/GetAllTagTerms

Therefore the redirection doesn't work.

Any ideas on how i could load the script after http://url/_vti_bin/SocialDataService.asmx/GetAllTagTerms

2 Answers 2


Try to load it ofter SP.js with executeOrDelayUntilScriptLoaded that should do the trick have a look here http://blog.lekman.com/2010/05/working-safely-with-sharepoint-client.html


Lars's answer is the ay to go probably, if you want a call to your own js function to happen directly after any out of the box js function call, expand the Lars's answer (load the actual js file after the needed out of the box js file) with jQUery.aop. This allows for "extending" other js function by adding a before or after call to it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.