Share via


Supported Namespaces JavaScript Client Object model SharePoint Server 2010 & 2013

Hello

In this day and age more and more customers are choosing to use Jquery in their customized pages and choose the JavaScript client object model in SharePoint 2010 and 2013. However, it turns out that anyone with skills can reverse engineer debugging the JavaScript client used internally by Microsoft but it shouldn't be used by customers / Developers.

Recently a customer reported an issue we using that kind of JavaScript. The code was as follows.

function FuncNaive1() {

        var OldCalendarNotify4a = SP.UI.ApplicationPages.CalendarNotify.$4a; /cahnge to $4b if Sp1 or later

        SP.UI.ApplicationPages.CalendarNotify.$4a = function ()          

           OldCalendarNotify4a();

            FuncNaive2();

        }

    }

As you can see, the code was calling to an internal function called SP.UI.ApplicationPages.CalendarNotify.$4a and even the customer was completely arware that we should change the var to $4b if SP1 or later. The internal function code looks as following:

Then he overwrites the function calling the old functionality and a new one created by him

It turns out that these actions are completely unsupported. It's not expected that a developer/customer call the function SP.UI.ApplicationPages.CalendarNotify.$4a due to it's not documented in the SDK of SharePoint 2010 nor SharePoint 2013, moreover you shouldn't "override" an internal function. Another point to add it's that Microsoft is free of changing the internal functionality, as you see in the customer comment concerning the SP1

Some months ago I talked regarding this topic in the blog https://blogs.msdn.com/b/calvarro/archive/2012/09/27/reflection-and-or-reverse-engineering-of-any-microsoft-sharepoint-version-is-not-supported.aspx  so you can check the blog entry for more info.

In order to know what namespaces functions/methods and objects are public and supported in the SPS 2010 and SPS 2013 SDK for the JavaScript object Model, you should check the following links or the SDK:

SPS 2010 => https://msdn.microsoft.com/en-us/library/ee552096(v=office.14).aspx

SPS 2013 => https://msdn.microsoft.com/en-us/library/jj193034.aspx

Kind Regards.

Héctor Calvarro Martín. SharePoint Dev/Core. Microsoft Support Escalation Engineer for EMEA