I have a sitecollection error when I click on "Follow" button. The error is

"Unable to get property 'showWaitScreenWithNoClose of undefined or null reference"

The error is occuring because of null value in "SP.Res.dialogLoading15" parameter.

In FolowSite.js file

         function follow() {
            waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose(SP.Res.dialogLoading15);

In the default.aspx, the code calling this function is as follows

   <a title="Follow this site and get back to it easily from your sites page." class="ms-promotedActionButton" id="site_follow_button" style="display: inline-block;" 
                    onmouseover="this.firstChild.firstChild.style.left='-217px'; this.firstChild.firstChild.style.top='-192px';" 
                    onmouseout="this.firstChild.firstChild.style.left='-218px'; this.firstChild.firstChild.style.top='-48px';" 
                    onclick="follow(); return false;" href="#">

For the site collections which has 'follow' button working, SP.Res.dialogLoading15 is not null.

Any ideas on what is causing the error


You need to wait for sp.js to be loaded. Use it as below:

function follow() {
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function() {
        var waitingDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose(SP.Res.dialogLoading15);
  • Thanks Gautham, The same code works on other sitecollections. Is there a way to find out, why this site collection is failing? – Nate Nov 11 '16 at 10:58
  • Probably different masterpages or different custom javascripts and other branding changes etc. – Gautam Sheth Nov 11 '16 at 11:07
  • @Gautham, They all use the same master pages, In the html code where the call is initiated, I dont see any code difference – Nate Nov 11 '16 at 20:26

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.