I am currently developing a jquery function which I intend to use to replace url gates -> http://mydomain:20000
As you know SharePoint use a usercontrol to embed the globalnavigation, and when rendered as HTML you find "/Subsite/Folder/Page.aspx" in the anchors tags' href.
My problem here is that my colleague has managed to develop a cross-site navigation for a costumer, and that costumer also has a MySite which uses this cross-site navigation and MySites usually resides on another gate entry, in my case gate 20000.
So in order for the users to navigate around without getting 403 errors just because the cross-site navigation doesn't remove the :20000 entry I want to use a jquery script to remove that entry. Only problem - Don't know how.
A scrapped version:
<script type="text/javascript">
$(document).ready(function () {
var urlContain = new RegExp(':20000');
$('#s4-topheader2 a').each(function () {
var href = this.getAttribute('href').replace(urlContain, '');
$(this).attr('href', href);
});
});
</script>
It works as intended, but unfortunately, it doesn't remove the :20000 from the domain, as I mentioned earlier, the anchors only seems to contain "/Subsite/Folder/Page.aspx" when rendered. Though when I hover over them, I can see in the bottom left corner of my browser that it contains the domain name, but not when I View source.
Ideas and thoughts to solve this are highly appreciated.