If we want to call the ECMAScript function on page load , we can get the error like
"Unable to get property 'get_current' of undefined or null reference"
Because , before sp.js loads which is required to run our ECMAScript function, was not loaded and our ECMA funcation calls.
So, we need to wait untill our sp.js loads.
So, we need to call that function as below :
$(document).ready(function(){
var reslt= ExecuteOrDelayUntilScriptLoaded( getUserTitle, "sp.js");
});
});
function GetUserTitle()
{
// function defination
}
"Unable to get property 'get_current' of undefined or null reference"
Because , before sp.js loads which is required to run our ECMAScript function, was not loaded and our ECMA funcation calls.
So, we need to wait untill our sp.js loads.
So, we need to call that function as below :
$(document).ready(function(){
var reslt= ExecuteOrDelayUntilScriptLoaded( getUserTitle, "sp.js");
});
});
function GetUserTitle()
{
// function defination
}
No comments:
Post a Comment