If I was ever in a situation where I had to move 1000 PDF documents from one document library to another, what is the best way to then update all 1000 of my SharePoint pages (from my Pages library), that was referencing /SiteCollectionDocuments/ in HTML anchor links?

I am a UI front-end developer, Thanks


One Solution:

In your master page write a script to check if the current anchor list is triggered, if yes change the location. As shown below

    $(document).ready(function() {

        $('a').click(function(event) {

                if($(this).attr('href').indexOf('SiteCollectionDocuments') > -1);
                var oldNav=$(this).attr('href');
                var newNav=oldNav.replace("SiteCollectionDocuments", "NewSiteCollectionDocuments");
                //i want to prevent

    <a href="http://www.SiteCollectionDocuments.com" id="yes">Read More &gt;&gt;</a>
  • Please mark it as answer if it solves your query – Varun Verma Aug 8 '14 at 11:22
  • Thank you Varun. I may have other PDF's in that original SiteCollectionDocuments, that will not be moved... – klewis Aug 8 '14 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.