home screen

Search



Number Of Result : 0

Result :


Tuesday, August 2, 2011

SP.ClientContext is null or not an object in ECMAScript

when you call
function Initialize()
{
var context = SP.ClientContext.get_context();
}

Initialize();


if you have a error message "SP.ClientContext is null or not an object"
In order to avoid this error you should:

//add more this one.
SP.SOD.executeOrDelayUntilScriptLoaded(Initialize, 'SP.js');

function Initialize()
{
var context = SP.ClientContext.get_context();
}

//Initialize(); REMOVED

No comments: