i have a tag cloud on my master page. I would like to redirect links of the tags within that tag cloud to another url (script below).
The script runs fine when i test it with the console in firefox but it doesn't work when i put it in the head of my master.
After investigation i have noticed that my script is loaded before a sharepoint webservice /_vti_bin/SocialDataService.asmx/GetAllTagTerms
which could be the reason!
My question is: would it be possible to use jquery to call that webservice and make it work?
$(document).ready(function () {
var $sel = $("#tagscloud a[href*='tagprofile.aspx?termid=']");
var rootUrl = $('#ctl00_RootUrlId').val();
$sel.each(function () {
var $this = $(this), href = $this.attr('href');
$this.attr('href', rootUrl + 'Recherche/Pages/Results.aspx?k=SocialTagId%3A%22' + href.slice(href.indexOf('tagprofile.aspx?termid=') + 23) + '%22');
});
});